-
Notifications
You must be signed in to change notification settings - Fork 166
LG-13864 Create profile after USPS enrollment #11034
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 |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| include IdvStepHelper | ||
| include SpAuthHelper | ||
| include InPersonHelper | ||
| include UspsIppHelper | ||
|
|
||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) | ||
|
|
@@ -494,4 +495,30 @@ | |
| expect(page).to have_current_path(idv_in_person_ready_to_verify_path) | ||
| end | ||
| end | ||
|
|
||
| context 'when the USPS enrollment fails during enter password' do | ||
| before do | ||
| user = user_with_2fa | ||
| sign_in_and_2fa_user(user) | ||
| begin_in_person_proofing(user) | ||
| complete_prepare_step(user) | ||
| complete_location_step | ||
| # Causes the schedule USPS enrollment request to throw a bad request error | ||
| complete_state_id_step(user, first_name: 'usps client error') | ||
|
||
| complete_ssn_step(user) | ||
| complete_verify_step(user) | ||
| fill_out_phone_form_ok(MfaContext.new(user).phone_configurations.first.phone) | ||
| click_idv_send_security_code | ||
| fill_in_code_with_last_phone_otp | ||
| click_submit_default | ||
| complete_enter_password_step(user) | ||
| end | ||
|
|
||
| it 'then an error displayed on the enter password page', allow_browser_log: true do | ||
| expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.re_enter_password')) | ||
| expect(page).to have_content( | ||
| 'There was an internal error processing your request. Please try again.', | ||
|
||
| ) | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,8 +32,8 @@ module InPersonHelper | |
| GOOD_IDENTITY_DOC_ZIPCODE = | ||
| (Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[:identity_doc_zipcode]).freeze | ||
|
|
||
| def fill_out_state_id_form_ok(same_address_as_id: false) | ||
| fill_in t('in_person_proofing.form.state_id.first_name'), with: GOOD_FIRST_NAME | ||
| def fill_out_state_id_form_ok(same_address_as_id: false, first_name: GOOD_FIRST_NAME) | ||
|
||
| fill_in t('in_person_proofing.form.state_id.first_name'), with: first_name | ||
| fill_in t('in_person_proofing.form.state_id.last_name'), with: GOOD_LAST_NAME | ||
| year, month, day = GOOD_DOB.split('-') | ||
| fill_in t('components.memorable_date.month'), with: month | ||
|
|
@@ -120,10 +120,10 @@ def complete_prepare_step(_user = nil) | |
| click_on t('forms.buttons.continue') | ||
| end | ||
|
|
||
| def complete_state_id_step(_user = nil, same_address_as_id: true) | ||
| def complete_state_id_step(_user = nil, same_address_as_id: true, first_name: GOOD_FIRST_NAME) | ||
| # Wait for page to load before attempting to fill out form | ||
| expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) | ||
| fill_out_state_id_form_ok(same_address_as_id: same_address_as_id) | ||
| fill_out_state_id_form_ok(same_address_as_id: same_address_as_id, first_name:) | ||
| click_idv_continue | ||
| unless same_address_as_id | ||
| expect(page).to have_current_path(idv_in_person_address_path, wait: 10) | ||
|
|
||
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.
Unimportant nit: I think these two lines read kind of confusingly: "If the user already as an in-person enrollment, schedule an in-person enrollment for them." I'm not sure if there's an easy way to fix this with a rename, though?
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 also find this confusing. Maybe we could rename
has_in_person_enrollment?tohas_unscheduled_in_person_enrollment?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 agree with that the naming could be better... my only issue is that the
has_in_person_enrollment?checks forpendingorestablishingin-person enrollments. Unscheduled should only care aboutestablishingin-person enrollments right?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.
Would
needs_in_person_verification?be a clearer method name? I got that idea from thein_person_verification_neededparam for profile_maker’s save_profile method.It could also be renamed
has_begun_in_person_proofing?, but I worry that’s too vague. Technically, a user who has a failed in_person_enrollment has also begun in person proofing.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 have a n00b question. If unscheduled only refers to establishing in_person_enrollments, why schedule an enrollment when a user has a pending or establishing in_person_enrollment? Could this conditional be refactored to only check if the user has an establishing in_person_enrollment?
The enrollment helper’s
schedule_in_person_enrollmentreturns if the user doesn’t have an establishing in_person_enrollment, which makes me think that this refactor wouldn’t actually change the method’s behavior.Let me know if I’m missing something.