Skip to content

Commit

Permalink
Update after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
c960657 committed Dec 17, 2024
1 parent 88192a7 commit 3c55311
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/controllers/passwords_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def put_update_with_params
end

test '#edit redirect if reset_password_token has expired' do
@user.reset_password_sent_at = @user.class.reset_password_within - 1.second
@user.reset_password_sent_at = Time.now - @user.class.reset_password_within - 1.second
@user.save
get :edit, params: { reset_password_token: @raw }
assert_equal "This password recovery link has expired, please request a new one.", flash[:alert]
Expand Down
11 changes: 5 additions & 6 deletions test/integration/recoverable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,12 @@ def reset_password(options = {}, &block)

test 'not authenticated user with invalid reset password token should not be able to change their password' do
user = create_user
reset_password reset_password_token: 'invalid_reset_password'
get edit_user_password_path(reset_password_token: 'invalid_reset_password')

assert_response :success
assert_current_url '/users/password'
assert_have_selector '#error_explanation'
assert_contain %r{Reset password token(.*)invalid}
assert_not user.reload.valid_password?('987654321')
assert_response :redirect
assert_redirected_to "/users/password/new"
follow_redirect!
assert_contain 'This password recovery link is invalid, please request a new one.'
end

test 'not authenticated user with valid reset password token but invalid password should not be able to change their password' do
Expand Down

0 comments on commit 3c55311

Please sign in to comment.