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
4 changes: 4 additions & 0 deletions app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class VerifyInfoController < ApplicationController
def show
increment_step_counts
analytics.idv_doc_auth_verify_visited(**analytics_arguments)
Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).
call('verify', :view, true)

if ssn_throttle.throttled?
redirect_to idv_session_errors_ssn_failure_url
Expand All @@ -27,6 +29,8 @@ def show
def update
return if idv_session.verify_info_step_document_capture_session_uuid
analytics.idv_doc_auth_verify_submitted(**analytics_arguments)
Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).
call('verify', :update, true)

pii[:uuid_prefix] = ServiceProvider.find_by(issuer: sp_session[:issuer])&.app_id

Expand Down
19 changes: 18 additions & 1 deletion spec/controllers/idv/verify_info_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
:flow_path => 'standard' }
end

let(:user) { create(:user) }

before do
allow(subject).to receive(:flow_session).and_return(flow_session)
user = build(:user, :with_phone, with: { phone: '+1 (415) 555-0130' })
stub_idv_steps_before_verify_step(user)
end

Expand Down Expand Up @@ -77,6 +78,14 @@
expect(@analytics).to have_received(:track_event).with(analytics_name, analytics_args)
end

it 'updates DocAuthLog verify_view_count' do
doc_auth_log = DocAuthLog.create(user_id: user.id)

expect { get :show }.to(
change { doc_auth_log.reload.verify_view_count }.from(0).to(1),
)
end

context 'when the user has already verified their info' do
it 'redirects to the review controller' do
controller.idv_session.profile_confirmation = true
Expand Down Expand Up @@ -145,6 +154,14 @@
)
end

it 'updates DocAuthLog verify_submit_count' do
doc_auth_log = DocAuthLog.create(user_id: user.id)

expect { put :update }.to(
change { doc_auth_log.reload.verify_submit_count }.from(0).to(1),
)
end

context 'when the user is ssn throttled' do
before do
Throttle.new(
Expand Down