X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dbbbd62ef1982e905ceb23f1278e9b4bfdb49d5b..550c4a3a45814fde5c809334c85f1ebc47659a82:/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