X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7b057545c0b2030aad9981bd93699f9e33ad7d5f..979a474c682c894125e0fe9ddfc5bae566ad895c:/test/abilities/abilities_test.rb?ds=sidebyside diff --git a/test/abilities/abilities_test.rb b/test/abilities/abilities_test.rb index f43b6bf50..99154b4b7 100644 --- a/test/abilities/abilities_test.rb +++ b/test/abilities/abilities_test.rb @@ -23,7 +23,6 @@ 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 @@ -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