Installed authentication-zero
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
2024-08-17 21:18:23 +02:00
parent cbe55aee36
commit c4b96a43e4
44 changed files with 988 additions and 10 deletions

View File

@@ -0,0 +1,26 @@
require "application_system_test_case"
class Identity::EmailsTest < ApplicationSystemTestCase
setup do
@user = sign_in_as(users(:lazaro_nixon))
end
test "updating the email" do
click_on "Change email address"
fill_in "New email", with: "new_email@hey.com"
fill_in "Password challenge", with: "Secret1*3*5*"
click_on "Save changes"
assert_text "Your email has been changed"
end
test "sending a verification email" do
@user.update! verified: false
click_on "Change email address"
click_on "Re-send verification email"
assert_text "We sent a verification email to your email address"
end
end

View File

@@ -0,0 +1,28 @@
require "application_system_test_case"
class Identity::PasswordResetsTest < ApplicationSystemTestCase
setup do
@user = users(:lazaro_nixon)
@sid = @user.generate_token_for(:password_reset)
end
test "sending a password reset email" do
visit sign_in_url
click_on "Forgot your password?"
fill_in "Email", with: @user.email
click_on "Send password reset email"
assert_text "Check your email for reset instructions"
end
test "updating password" do
visit edit_identity_password_reset_url(sid: @sid)
fill_in "New password", with: "Secret6*4*2*"
fill_in "Confirm new password", with: "Secret6*4*2*"
click_on "Save changes"
assert_text "Your password was reset successfully. Please sign in"
end
end