-
Notifications
You must be signed in to change notification settings - Fork 166
Move USPS verification specs to shared example #1581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,12 @@ | ||
| require 'rails_helper' | ||
|
|
||
| feature 'USPS verification' do | ||
| include SamlAuthHelper | ||
| include IdvHelper | ||
|
|
||
| context 'signing in when profile is pending USPS verification' do | ||
| it_behaves_like 'signing in with pending USPS verification' | ||
| it_behaves_like 'signing in with pending USPS verification', :saml | ||
| it_behaves_like 'signing in with pending USPS verification', :oidc | ||
| end | ||
| end | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,45 @@ | ||
| shared_examples 'signing in with pending USPS verification' do |sp| | ||
| it 'prompts for confirmation code at sign in' do | ||
| otp = 'abc123' | ||
| profile = create( | ||
| :profile, | ||
| deactivation_reason: :verification_pending, | ||
| phone_confirmed: false, | ||
| pii: { otp: otp, ssn: '123-45-6789', dob: '1970-01-01' } | ||
| ) | ||
| user = profile.user | ||
|
|
||
| visit_idp_from_sp_with_loa3(sp) | ||
|
|
||
| if %i[saml oidc].include?(sp) | ||
| sign_in_via_branded_page(user) | ||
| else | ||
| sign_in_live_with_2fa(user) | ||
| end | ||
|
|
||
| expect(current_path).to eq verify_account_path | ||
| expect(page).to have_content t('idv.messages.usps.resend') | ||
|
|
||
| fill_in t('forms.verify_profile.name'), with: otp | ||
| click_button t('forms.verify_profile.submit') | ||
|
|
||
| expect(user.events.account_verified.size).to eq 1 | ||
| expect(page).to_not have_content(t('account.index.verification.reactivate_button')) | ||
|
|
||
| if %i[saml oidc].include?(sp) | ||
| expect(current_path).to eq(sign_up_completed_path) | ||
|
|
||
| click_button t('forms.buttons.continue') | ||
|
|
||
| if sp == :saml | ||
| expect(current_url).to eq @saml_authn_request | ||
| elsif sp == :oidc | ||
| redirect_uri = URI(current_url) | ||
|
|
||
| expect(redirect_uri.to_s).to start_with('http://localhost:7654/auth/result') | ||
| end | ||
| else | ||
| expect(current_path).to eq account_path | ||
| end | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we were planning on having these live under the
account creationfeature? I guess this is kind of a gray area since the account is already created, but it seems like it is still a part of that flow?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for this case, it makes sense to have a separate USPS verification folder since the user will need to wait several days to receive the code before being able to finish, and within this feature, there are several scenarios to consider, such as entering the correct vs wrong code, asking for a new letter, exceeding the max allowed amount of letters, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I added a new scenario for the context where the user is signing back in directly (i.e. not coming from an SP). PTAL.