Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## User Permissions Test Let us now replace our trivial test with real tests. Looking at `user.rb` the function most in need of testing is probably `update_permitted?`. The Hobo permission system is not invoked when you simply change attributes on a model. For example, `@user.name = "Another Name"` will always succeed even though `User#update_permitted?` sometimes doesn't allow the name to change. To invoke the Hobo permissions system, we need to do two things: set the `acting_user` for the model, and change the attributes through the Hobo API. We can do both using (`user_update_attributes`)[/manual/permissions#the_permissions_api]. Knowing that, let's create a test: SHOW_PATCH
- Loading branch information