+ end
+
+ [:create, :hide, :unhide].each do |action|
+ assert ability.cannot?(action, DiaryComment), "should not be able to #{action} DiaryComments"
+ end
+ end
+
+ test "note permissions for a guest" do
+ ability = Ability.new nil
+
+ [:index].each do |action|
+ assert ability.can?(action, Note), "should be able to #{action} Notes"
+ end
+ end
+
+ test "user roles permissions for a guest" do
+ ability = Ability.new nil
+
+ [:grant, :revoke].each do |action|
+ assert ability.cannot?(action, UserRole), "should not be able to #{action} UserRoles"