Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def user_params
- params.require(:user).permit(:name, :email, :password,
- :password_confirmation,
- :admin)
- end
- test "should not allow the admin attribute to be edited via the web" do
- log_in_as(@other_user)
- assert_not @other_user.admin?
- patch :update, id: @other_user, user: { password: "",
- password_confirmation: "",
- admin: true }
- assert_not @other_user.reload.admin?
- end
- ERROR["test_should_not_allow_the_admin_attribute_to_be_edited_via_the_web", UsersControllerTest, 3.2600422599352896]
- test_should_not_allow_the_admin_attribute_to_be_edited_via_the_web#UsersControllerTest (3.26s)
- URI::InvalidURIError: URI::InvalidURIError: bad URI(is not URI?): http://www.example.com:80update
- test/controllers/users_controller_test.rb:37:in `block in <class:UsersControllerTest>'
- @other_user.reload.admin?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement