1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Fix arguments to find_by_token_for (#299)

This commit is contained in:
Dwight Watson 2024-02-05 12:10:48 +11:00 committed by GitHub
parent 77ff9fd2a2
commit 97789bc538
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 1 deletions

View file

@ -0,0 +1,30 @@
require "test_helper"
class PasswordResetsControllerTest < ActionDispatch::IntegrationTest
setup do
@user = users(:bob)
end
test "new" do
get new_password_reset_path
assert_response :ok
end
test "create" do
assert_enqueued_emails 1 do
post password_reset_path, params: { email: @user.email }
assert_redirected_to root_url
end
end
test "edit" do
get edit_password_reset_path(token: @user.generate_token_for(:password_reset))
assert_response :ok
end
test "update" do
patch password_reset_path(token: @user.generate_token_for(:password_reset)),
params: { user: { password: "password", password_confirmation: "password" } }
assert_redirected_to new_session_url
end
end