test cleanup

This commit is contained in:
Mark Moser 2016-08-24 16:47:15 -05:00
parent 2f6d006404
commit fa5af8ffa1
3 changed files with 18 additions and 1 deletions

View File

@ -47,7 +47,7 @@ module Admin
if user.update(reset_params)
redirect_to admin_login_path, success: "Password has been reset. Please log in."
else
redirect_to(admin_reset_request_path)
redirect_to admin_reset_request_path, flash: { error: "Password was not updated." }
end
end

View File

@ -74,5 +74,16 @@ module Admin
assert_redirected_to admin_auth_path
assert_match(/reset.*log/i, flash[:success])
end
test "should fail to reset with mistyped password" do
user = users(:admin)
user.setup_reset
post admin_reset_password_url, params: { auth:
{ reset_token: user.reset_token, password: '12345', password_confirmation: 'abcde' } }
assert :success
assert flash[:error]
end
end
end

View File

@ -22,5 +22,11 @@ module Admin
assert_redirected_to admin_profile_url
assert flash[:success]
end
test "should FAIL update" do
post admin_profile_url, params: { user: { name: '' } }
assert :success
assert flash[:error]
end
end
end