]> git.openstreetmap.org Git - rails.git/commitdiff
Fix error messages when users should not be able to do things
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 31 Oct 2018 10:42:49 +0000 (11:42 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 31 Oct 2018 10:42:49 +0000 (11:42 +0100)
test/models/abilities_test.rb

index be0b61af85f6c1ab17f58c5f0cf6e52e3c8e3b5e..fc37b0e7df9ab034f731057d298a339f408e716a 100644 (file)
@@ -22,8 +22,8 @@ class GuestAbilityTest < AbilityTest
     end
 
     [:create, :edit, :comment, :subscribe, :unsubscribe, :hide, :hidecomment].each do |action|
-      assert ability.cannot?(action, DiaryEntry), "should be able to #{action} DiaryEntries"
-      assert ability.cannot?(action, DiaryComment), "should be able to #{action} DiaryEntries"
+      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
 end
@@ -37,8 +37,8 @@ class UserAbilityTest < AbilityTest
     end
 
     [:hide, :hidecomment].each do |action|
-      assert ability.cannot?(action, DiaryEntry), "should be able to #{action} DiaryEntries"
-      assert ability.cannot?(action, DiaryComment), "should be able to #{action} DiaryEntries"
+      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|