Added authentication_zero
This commit is contained in:
26
test/system/identity/emails_test.rb
Normal file
26
test/system/identity/emails_test.rb
Normal 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
|
||||
28
test/system/identity/password_resets_test.rb
Normal file
28
test/system/identity/password_resets_test.rb
Normal 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
|
||||
Reference in New Issue
Block a user