Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 user_path(@other_user), params: {
- user: { password: FILL_IN,
- password_confirmation: FILL_IN,
- admin: FILL_IN} }
- assert_not @other_user.FILL_IN.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 user_path(@other_user), params: {
- user: { password: 'password',
- password_confirmation: 'password',
- admin: true } }
- assert_not @other_user.reload.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 user_path(@other_user), params: {
- user: { password: 'foobar',
- password_confirmation: 'foobar',
- admin: true } }
- assert_not @other_user.reload.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 user_path(@other_user), params: {
- user: { password: 'foo',
- password_confirmation: 'bar',
- admin: true } }
- assert_not @other_user.reload.admin?
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement