-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix arguments to find_by_token_for (#299)
- Loading branch information
1 parent
77ff9fd
commit 97789bc
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |