- assert ability.cannot?(action, DiaryEntry), "should be able to #{action} DiaryEntries"
- assert ability.cannot?(action, DiaryComment), "should be able to #{action} DiaryEntries"
- end
- end
-
- test "user preferences" do
- user = create(:user)
- ability = Ability.new create(:user), tokens
-
- [:read, :read_one, :update, :update_one, :delete_one].each do |act|
- assert ability.cannot? act, UserPreference
+ assert ability.cannot?(action, DiaryEntry), "should not be able to #{action} DiaryEntries"
+ assert ability.cannot?(action, DiaryComment), "should not be able to #{action} DiaryEntries"