-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LG-1316 Send an email when a user adds a phone to their account (#3017)
**Why**: So that the user is alerted that a new phone has been added to their account.
- Loading branch information
Showing
10 changed files
with
59 additions
and
29 deletions.
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
File renamed without changes.
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
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
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,22 @@ | ||
require 'rails_helper' | ||
|
||
describe 'Add a new phone number' do | ||
scenario 'Adding and confirming a new phone number allows the phone number to be used for MFA' do | ||
user = create(:user, :signed_up) | ||
phone = '+1 (225) 278-1234' | ||
|
||
expect(UserMailer).to receive(:phone_added).with(user.email_addresses.first).and_call_original | ||
|
||
sign_in_and_2fa_user(user) | ||
click_on t('account.index.phone_add') | ||
fill_in :phone, with: phone | ||
click_continue | ||
fill_in_code_with_last_phone_otp | ||
click_submit_default | ||
|
||
expect(page).to have_current_path(account_path) | ||
expect(user.reload.phone_configurations.count).to eq(2) | ||
expect(user.phone_configurations[0].confirmed_at).to be_present | ||
expect(user.phone_configurations[1].confirmed_at).to be_present | ||
end | ||
end |
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