]> git.openstreetmap.org Git - rails.git/blobdiff - test/abilities/abilities_test.rb
Merge remote-tracking branch 'upstream/pull/2983' into master
[rails.git] / test / abilities / abilities_test.rb
index f43b6bf50de811b2f5b5fcc66fdca7d82e99b299..c27f758333d7d5818f2e6d1b52011369472707fb 100644 (file)
@@ -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