Skip to content

Commit

Permalink
LG-9019 Users in Puerto Rico go automatically to Update Address page (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
soniaconnolly authored and mitchellhenke committed Mar 14, 2023
1 parent 9036caf commit 232ae7a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
10 changes: 9 additions & 1 deletion app/controllers/idv/ssn_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions spec/controllers/idv/ssn_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion spec/features/idv/doc_auth/address_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 232ae7a

Please sign in to comment.