Advertisement
Guest User

Untitled

a guest
Oct 17th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. def user_params
  2. params.require(:user).permit(:name, :email, :password,
  3. :password_confirmation,
  4. :admin)
  5. end
  6.  
  7. test "should not allow the admin attribute to be edited via the web" do
  8. log_in_as(@other_user)
  9. assert_not @other_user.admin?
  10. patch :update, id: @other_user, user: { password: "",
  11. password_confirmation: "",
  12. admin: true }
  13. assert_not @other_user.reload.admin?
  14. end
  15.  
  16. ERROR["test_should_not_allow_the_admin_attribute_to_be_edited_via_the_web", UsersControllerTest, 3.2600422599352896]
  17. test_should_not_allow_the_admin_attribute_to_be_edited_via_the_web#UsersControllerTest (3.26s)
  18. URI::InvalidURIError: URI::InvalidURIError: bad URI(is not URI?): http://www.example.com:80update
  19. test/controllers/users_controller_test.rb:37:in `block in <class:UsersControllerTest>'
  20.  
  21. @other_user.reload.admin?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement