Advertisement
Guest User

Untitled

a guest
Sep 8th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. test "should not allow the admin attribute to be edited via the web" do
  2. log_in_as(@other_user)
  3. assert_not @other_user.admin?
  4. patch user_path(@other_user), params: {
  5. user: { password: FILL_IN,
  6. password_confirmation: FILL_IN,
  7. admin: FILL_IN} }
  8. assert_not @other_user.FILL_IN.admin?
  9. end
  10.  
  11. test "should not allow the admin attribute to be edited via the web" do
  12. log_in_as(@other_user)
  13. assert_not @other_user.admin?
  14. patch user_path(@other_user), params: {
  15. user: { password: 'password',
  16. password_confirmation: 'password',
  17. admin: true } }
  18. assert_not @other_user.reload.admin?
  19. end
  20.  
  21. test "should not allow the admin attribute to be edited via the web" do
  22. log_in_as(@other_user)
  23. assert_not @other_user.admin?
  24. patch user_path(@other_user), params: {
  25. user: { password: 'foobar',
  26. password_confirmation: 'foobar',
  27. admin: true } }
  28. assert_not @other_user.reload.admin?
  29. end
  30.  
  31. test "should not allow the admin attribute to be edited via the web" do
  32. log_in_as(@other_user)
  33. assert_not @other_user.admin?
  34. patch user_path(@other_user), params: {
  35. user: { password: 'foo',
  36. password_confirmation: 'bar',
  37. admin: true } }
  38. assert_not @other_user.reload.admin?
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement