-
Notifications
You must be signed in to change notification settings - Fork 166
Adds USPS completion page and wires up USPS confirmation form #1421
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| class InlineInput < SimpleForm::Inputs::StringInput | ||
| def input(_wrapper_options) | ||
| input_html_classes.push('col-10 field monospace') | ||
| template.content_tag( | ||
| :div, builder.text_field(attribute_name, input_html_options), | ||
| class: 'col col-12 sm-col-4 mb4 sm-mb0' | ||
| ) | ||
| end | ||
|
|
||
| def input_type | ||
| :text | ||
| end | ||
|
|
||
| def builder | ||
| @builder ||= :builder | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,12 +9,13 @@ en: | |
| messages: | ||
| already_confirmed: was already confirmed, please try signing in | ||
| blank: Please fill in this field. | ||
| confirmation_code_incorrect: Incorrect code. Did you type it in correctly? | ||
| confirmation_invalid_token: > | ||
| Invalid confirmation link. Either the link expired or you | ||
| already confirmed your account. | ||
| Invalid confirmation link. Either the link expired or you | ||
| already confirmed your account. | ||
| confirmation_period_expired: > | ||
| Expired confirmation link. | ||
| You can click "Resend confirmation instructions" to get another one. | ||
| You can click "Resend confirmation instructions" to get another one. | ||
|
||
| expired: has expired, please request a new one | ||
| format_mismatch: Please match the requested format. | ||
| improbable_phone: Invalid phone number. Please make sure you enter a 10-digit phone number. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,22 +5,23 @@ | |
| include IdvHelper | ||
|
|
||
| context 'First time registration' do | ||
| it 'redirects to original SAML Authn Request after IdV is complete', email: true do | ||
| let(:email) { 'test@test.com' } | ||
| before do | ||
| allow(FeatureManagement).to receive(:prefill_otp_codes?).and_return(true) | ||
| saml_authn_request = auth_request.create(loa3_with_bundle_saml_settings) | ||
| @saml_authn_request = auth_request.create(loa3_with_bundle_saml_settings) | ||
| end | ||
|
|
||
| it 'redirects to original SAML Authn Request after IdV is complete', email: true do | ||
| xmldoc = SamlResponseDoc.new('feature', 'response_assertion') | ||
| email = 'test@test.com' | ||
|
|
||
| visit saml_authn_request | ||
| click_link t('sign_up.registrations.create_account') | ||
| submit_form_with_valid_email | ||
| click_confirmation_link_in_email(email) | ||
| submit_form_with_valid_password | ||
| set_up_2fa_with_valid_phone | ||
| enter_2fa_code | ||
| visit @saml_authn_request | ||
|
|
||
| saml_register_loa3_user(email) | ||
|
|
||
| expect(current_path).to eq verify_path | ||
| click_on 'Yes' | ||
|
|
||
| click_idv_begin | ||
|
|
||
| user = User.find_with_email(email) | ||
| complete_idv_profile_ok(user.reload) | ||
| click_acknowledge_personal_key | ||
|
|
@@ -41,14 +42,42 @@ | |
| end | ||
|
|
||
| click_on I18n.t('forms.buttons.continue') | ||
| expect(current_url).to eq saml_authn_request | ||
| expect(current_url).to eq @saml_authn_request | ||
|
|
||
| user_access_key = user.unlock_user_access_key(Features::SessionHelper::VALID_PASSWORD) | ||
| profile_phone = user.active_profile.decrypt_pii(user_access_key).phone | ||
|
|
||
| expect(xmldoc.phone_number.children.children.to_s).to eq(profile_phone) | ||
| end | ||
|
|
||
| it 'allows the user to select verification via USPS letter', email: true do | ||
| visit @saml_authn_request | ||
|
|
||
| saml_register_loa3_user(email) | ||
|
|
||
| click_idv_begin | ||
|
|
||
| fill_out_idv_form_ok | ||
| click_idv_continue | ||
| fill_out_financial_form_ok | ||
| click_idv_continue | ||
|
|
||
| click_idv_address_choose_usps | ||
|
|
||
| click_on t('idv.buttons.send_letter') | ||
|
|
||
| expect(current_path).to eq verify_review_path | ||
|
|
||
| fill_in :user_password, with: user_password | ||
| click_submit_default | ||
|
|
||
| expect(current_url).to eq verify_confirmations_url | ||
|
||
| click_acknowledge_personal_key | ||
|
|
||
| expect(current_url).to eq(account_url) | ||
| expect(page).to have_content(t('account.index.verification.reactivate_button')) | ||
| end | ||
|
|
||
| it 'shows user the start page with accordion' do | ||
| saml_authn_request = auth_request.create(loa3_with_bundle_saml_settings) | ||
| sp_content = [ | ||
|
|
@@ -130,18 +159,19 @@ | |
| context 'having previously selected USPS verification' do | ||
| let(:phone_confirmed) { false } | ||
|
|
||
| it 'prompts for OTP at sign in' do | ||
| it 'prompts for confirmation code at sign in' do | ||
| saml_authn_request = auth_request.create(loa3_with_bundle_saml_settings) | ||
|
|
||
| visit saml_authn_request | ||
|
|
||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq verify_account_path | ||
|
|
||
| fill_in 'Secret code', with: otp | ||
| fill_in t('forms.verify_profile.name'), with: usps_otp_code_for(user) | ||
| click_button t('forms.verify_profile.submit') | ||
|
|
||
| expect(current_path).to eq(sign_up_completed_path) | ||
| find('input').click | ||
|
|
||
| expect(current_url).to eq saml_authn_request | ||
| end | ||
| end | ||
|
|
||
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.
Are we explicitly making a distinction between the USPS confirmation code and other security codes? For example, we have
otp_incorrect: Security code is incorrect, but here we are changing the language. Is that intentional?Uh oh!
There was an error while loading. Please reload this page.
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 did change the language intentionally. The new designs, which I'll be linking in a moment, called for it.