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: 10 additions & 1 deletion app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module IdvStepConcern
include FraudReviewConcern
include Idv::AbTestAnalyticsConcern
include Idv::VerifyByMailConcern
include Idv::DocAuthVendorConcern
Comment thread
AShukla-GSA marked this conversation as resolved.
Outdated

included do
before_action :confirm_two_factor_authenticated
Expand Down Expand Up @@ -71,7 +72,15 @@ def confirm_hybrid_handoff_needed
# available when the user tries to redo document capture.
if idv_session.skip_hybrid_handoff? || !FeatureManagement.idv_allow_hybrid_flow?
idv_session.flow_path = 'standard'
redirect_to idv_document_capture_url
redirect_to vendor_document_capture_url
end
end

def vendor_document_capture_url
if doc_auth_vendor == Idp::Constants::Vendors::SOCURE
idv_socure_document_capture_url
else
idv_document_capture_url
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def update
if result.success?
redirect_to idv_ssn_url
else
redirect_to idv_document_capture_url
redirect_to vendor_document_capture_url
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def update_document_capture_session_requested_at(session_uuid)

def bypass_send_link_steps
idv_session.flow_path = 'standard'
redirect_to idv_document_capture_url
redirect_to vendor_document_capture_url

analytics.idv_doc_auth_hybrid_handoff_submitted(
**analytics_arguments.merge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def show
redirect_to idv_hybrid_mobile_capture_complete_url
end

analytics.idv_doc_auth_document_capture_visited(**analytics_arguments)
session[:socure_docv_wait_polling_started_at] = nil

Funnel::DocAuth::RegisterStep.new(document_capture_user.id, sp_session[:issuer])
Expand Down
1 change: 1 addition & 0 deletions app/controllers/idv/socure/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DocumentCaptureController < ApplicationController
before_action :fetch_test_verification_data, only: [:update]

def show
analytics.idv_doc_auth_document_capture_visited(**analytics_arguments)
Comment thread
AShukla-GSA marked this conversation as resolved.
Outdated
idv_session.socure_docv_wait_polling_started_at = nil

Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer])
Expand Down
2 changes: 2 additions & 0 deletions spec/controllers/concerns/idv_step_concern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def show
routes.draw do
get 'show' => 'anonymous#show'
end
allow(controller).to receive(:document_capture_session)
.and_return(create(:document_capture_session, user:))
end

context 'redo specified' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@
get(:show)
end

it 'correctly logs idv_doc_auth_document_capture_visited' do
expect(@analytics).to have_logged_event(
'IdV: doc auth document_capture visited',
hash_including(
step: 'socure_document_capture',
flow_path: 'hybrid',
),
)
end

it 'creates a DocumentRequest' do
expect(request_class).to have_received(:new)
.with(
Expand Down
12 changes: 12 additions & 0 deletions spec/features/idv/doc_auth/socure_document_capture_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@
end

it 'shows the Try Again page and allows user to start IPP', allow_browser_log: true do
expect(fake_analytics).to_not have_logged_event(
'IdV: doc auth document_capture visited',
hash_including(
step: 'document_capture',
),
)
expect(fake_analytics).to have_logged_event(
'IdV: doc auth document_capture visited',
hash_including(
step: 'socure_document_capture',
),
)
expect(page).to have_current_path(fake_socure_document_capture_app_url)
visit idv_socure_document_capture_path
expect(page).to have_current_path(idv_socure_document_capture_path)
Expand Down