]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/abilities_test.rb
Add testing for moderator users and issues
[rails.git] / test / models / abilities_test.rb
index 2bae4e88cb156aa2df05cdbf2e2c9bca02912fa2..be0b61af85f6c1ab17f58c5f0cf6e52e3c8e3b5e 100644 (file)
@@ -40,6 +40,20 @@ class UserAbilityTest < AbilityTest
       assert ability.cannot?(action, DiaryEntry), "should be able to #{action} DiaryEntries"
       assert ability.cannot?(action, DiaryComment), "should be able to #{action} DiaryEntries"
     end
+
+    [:index, :show, :resolve, :ignore, :reopen].each do |action|
+      assert ability.cannot?(action, Issue), "should not be able to #{action} Issues"
+    end
+  end
+end
+
+class ModeratorAbilityTest < AbilityTest
+  test "Issue permissions" do
+    ability = Ability.new create(:moderator_user)
+
+    [:index, :show, :resolve, :ignore, :reopen].each do |action|
+      assert ability.can?(action, Issue), "should be able to #{action} Issues"
+    end
   end
 end