X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7b057545c0b2030aad9981bd93699f9e33ad7d5f..0bdc865d9fb8da48852372351b86bd42f9772266:/test/abilities/abilities_test.rb diff --git a/test/abilities/abilities_test.rb b/test/abilities/abilities_test.rb index f43b6bf50..c27f75833 100644 --- a/test/abilities/abilities_test.rb +++ b/test/abilities/abilities_test.rb @@ -23,14 +23,13 @@ class GuestAbilityTest < AbilityTest [:create, :edit, :comment, :subscribe, :unsubscribe, :hide, :hidecomment].each do |action| assert ability.cannot?(action, DiaryEntry), "should not be able to #{action} DiaryEntries" - assert ability.cannot?(action, DiaryComment), "should not be able to #{action} DiaryEntries" end end test "note permissions for a guest" do ability = Ability.new nil - [:mine].each do |action| + [:index].each do |action| assert ability.can?(action, Note), "should be able to #{action} Notes" end end @@ -54,7 +53,6 @@ class UserAbilityTest < AbilityTest [:hide, :hidecomment].each do |action| assert ability.cannot?(action, DiaryEntry), "should not be able to #{action} DiaryEntries" - assert ability.cannot?(action, DiaryComment), "should not be able to #{action} DiaryEntries" end [:index, :show, :resolve, :ignore, :reopen].each do |action| @@ -78,6 +76,10 @@ class ModeratorAbilityTest < AbilityTest [:grant, :revoke].each do |action| assert ability.cannot?(action, UserRole), "should not be able to #{action} UserRoles" end + + [:hide, :hidecomment].each do |action| + assert ability.can?(action, DiaryEntry), "should be able to #{action} DiaryEntries" + end end end @@ -87,10 +89,6 @@ class AdministratorAbilityTest < AbilityTest [:index, :rss, :show, :comments, :create, :edit, :comment, :subscribe, :unsubscribe, :hide, :hidecomment].each do |action| assert ability.can?(action, DiaryEntry), "should be able to #{action} DiaryEntries" end - - [:hide, :hidecomment].each do |action| - assert ability.can?(action, DiaryComment), "should be able to #{action} DiaryComment" - end end test "User Roles permissions for an administrator" do