Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def confirm_agreement_step_complete
end

def confirm_hybrid_handoff_needed
setup_for_redo if params[:redo]

return if !flow_session[:flow_path]

if flow_session[:flow_path] == 'standard'
Expand All @@ -220,6 +222,15 @@ def confirm_hybrid_handoff_needed
end
end

def setup_for_redo
flow_session[:redo_document_capture] = true
if flow_session[:skip_upload_step]
flow_session[:flow_path] = 'standard'
else
flow_session[:flow_path] = nil
end
end

def formatted_destination_phone
raw_phone = params.require(:doc_auth).permit(:phone)
PhoneFormatter.format(raw_phone, country_code: 'US')
Expand Down
9 changes: 4 additions & 5 deletions app/views/idv/in_person/verify_info/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ locals:
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
link: render(
FormLinkComponent.new(
href: idv_doc_auth_step_path(step: :redo_document_capture),
method: :put,
).with_content(t('doc_auth.headings.capture_scan_warning_link')),
link: link_to(
t('doc_auth.headings.capture_scan_warning_link'),
idv_hybrid_handoff_url(redo: true),
'aria-label': t('doc_auth.headings.capture_scan_warning_link'),
),
) %>
<% end %>
Expand Down
8 changes: 7 additions & 1 deletion app/views/idv/link_sent/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,10 @@
<%= javascript_packs_tag_once 'doc-capture-polling' %>
<% end %>

<%= render 'idv/shared/back', action: 'cancel_link_sent', class: 'link-sent-back-link', step_url: :idv_doc_auth_step_url %>
<div class="margin-top-5 padding-top-2 border-top border-primary-light">
<%= link_to(
'‹ ' + t('forms.buttons.back'),
idv_hybrid_handoff_url(redo: true),
class: 'link-sent-back-link',
) %>
</div>
9 changes: 4 additions & 5 deletions app/views/idv/verify_info/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ locals:
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
link: render(
FormLinkComponent.new(
href: idv_doc_auth_step_path(step: :redo_document_capture),
method: :put,
).with_content(t('doc_auth.headings.capture_scan_warning_link')),
link: link_to(
t('doc_auth.headings.capture_scan_warning_link'),
idv_hybrid_handoff_url(redo: true),
'aria-label': t('doc_auth.headings.capture_scan_warning_link'),
),
) %>
<% end %>
Expand Down
27 changes: 27 additions & 0 deletions spec/controllers/idv/hybrid_handoff_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,33 @@
end
end

context 'redo document capture' do
it 'does not redirect in standard flow' do
subject.user_session['idv/doc_auth'][:flow_path] = 'standard'

get :show, params: { redo: true }

expect(response).to render_template :show
end

it 'does not redirect in hybrid flow' do
subject.user_session['idv/doc_auth'][:flow_path] = 'hybrid'

get :show, params: { redo: true }

expect(response).to render_template :show
end

it 'redirects to document_capture on a mobile device' do
subject.user_session['idv/doc_auth'][:flow_path] = 'standard'
subject.user_session['idv/doc_auth'][:skip_upload_step] = true

get :show, params: { redo: true }

expect(response).to redirect_to(idv_document_capture_url)
end
end

describe '#update' do
let(:analytics_name) { 'IdV: doc auth upload submitted' }

Expand Down
4 changes: 2 additions & 2 deletions spec/features/idv/actions/cancel_link_sent_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
complete_doc_auth_steps_before_link_sent_step
end

it 'returns to link sent step' do
it 'returns to hybrid_handoff step' do
click_doc_auth_back_link

expect(page).to have_current_path(idv_hybrid_handoff_path)
expect(page).to have_current_path(idv_hybrid_handoff_path, ignore_query: true)
end
end