From 232ae7a90fc5be58ecf9280d71bd75562086d843 Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Mon, 13 Mar 2023 14:32:43 -0700 Subject: [PATCH] LG-9019 Users in Puerto Rico go automatically to Update Address page (#7976) * After SSN step, take users with Puerto Rico addresses directly to Update Address page To help users in Puerto Rico verify their identities, automatically take them to the Update Address page which has guidance on how to edit a Puerto Rico address to be more likely to pass the Lexisnexis Instant Verify step. changelog: User-Facing Improvements, Identity Verification, take users with Puerto Rico addresses directly to the Update Address page after entering their SSN. --- app/controllers/idv/ssn_controller.rb | 10 +++++++++- spec/controllers/idv/ssn_controller_spec.rb | 8 ++++++++ spec/features/idv/doc_auth/address_step_spec.rb | 6 +++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/controllers/idv/ssn_controller.rb b/app/controllers/idv/ssn_controller.rb index dffa968fc6d..76ddf64111a 100644 --- a/app/controllers/idv/ssn_controller.rb +++ b/app/controllers/idv/ssn_controller.rb @@ -38,7 +38,7 @@ def update if form_response.success? flow_session['pii_from_doc'][:ssn] = params[:doc_auth][:ssn] idv_session.invalidate_steps_after_ssn! - redirect_to idv_verify_info_url + redirect_to next_url else @error_message = form_response.first_error_message render :show, locals: extra_view_variables @@ -55,6 +55,14 @@ def extra_view_variables private + def next_url + if @pii[:state] == 'PR' + idv_address_url + else + idv_verify_info_url + end + end + def analytics_arguments { flow_path: flow_path, diff --git a/spec/controllers/idv/ssn_controller_spec.rb b/spec/controllers/idv/ssn_controller_spec.rb index 1d2ec862b51..19a9a49da96 100644 --- a/spec/controllers/idv/ssn_controller_spec.rb +++ b/spec/controllers/idv/ssn_controller_spec.rb @@ -110,6 +110,14 @@ expect(flow_session['pii_from_doc'][:ssn]).to eq(ssn) end + it 'redirects to address controller for Puerto Rico addresses' do + flow_session['pii_from_doc'][:state] = 'PR' + + put :update, params: params + + expect(response).to redirect_to(idv_address_url) + end + it 'sends analytics_submitted event with correct step count' do get :show put :update, params: params diff --git a/spec/features/idv/doc_auth/address_step_spec.rb b/spec/features/idv/doc_auth/address_step_spec.rb index fffcb328841..b55352e51b2 100644 --- a/spec/features/idv/doc_auth/address_step_spec.rb +++ b/spec/features/idv/doc_auth/address_step_spec.rb @@ -48,12 +48,16 @@ complete_doc_auth_steps_before_document_capture_step complete_document_capture_step_with_yml('spec/fixtures/puerto_rico_resident.yml') complete_ssn_step - click_button t('idv.buttons.change_address_label') end it 'shows address guidance and hint text' do + expect(page).to have_current_path(idv_address_url) expect(page.body).to include(t('doc_auth.info.address_guidance_puerto_rico_html')) expect(page).to have_content(t('forms.example')) + fill_in 'idv_form_address1', with: '123 Calle Carlos' + fill_in 'idv_form_address2', with: 'URB Las Gladiolas' + click_button t('forms.buttons.submit.update') + expect(page).to have_current_path(idv_verify_info_path) end end end