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
2 changes: 1 addition & 1 deletion app/controllers/frontend_log_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FrontendLogController < ApplicationController
'IdV: forgot password visited' => :idv_forgot_password,
'IdV: password confirm visited' => :idv_review_info_visited,
'IdV: password confirm submitted' => proc do |analytics|
analytics.idv_review_complete
analytics.idv_review_complete(success: true)
analytics.idv_final(success: true)
end,
'IdV: personal key visited' => :idv_personal_key_visited,
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/idv/review_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def confirm_idv_phone_confirmed
def confirm_current_password
return if valid_password?

analytics.idv_review_complete(success: false)
flash[:error] = t('idv.errors.incorrect_password')
redirect_to idv_review_url
end
Expand All @@ -46,7 +47,7 @@ def create
init_profile
user_session[:need_personal_key_confirmation] = true
redirect_to next_step
analytics.idv_review_complete
analytics.idv_review_complete(success: true)
analytics.idv_final(success: true)

return unless FeatureManagement.reveal_gpo_code?
Expand Down
9 changes: 7 additions & 2 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,13 @@ def idv_proofing_resolution_result_missing
end

# User submitted IDV password confirm page
def idv_review_complete
track_event('IdV: review complete')
# @param [Boolean] success
def idv_review_complete(success:, **extra)
track_event(
'IdV: review complete',
success: success,
**extra,
)
end

# User visited IDV password confirm page
Expand Down
12 changes: 11 additions & 1 deletion spec/controllers/idv/review_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,19 @@ def show
context 'user fails to supply correct password' do
before do
idv_session.applicant = user_attrs.merge(phone_confirmed_at: Time.zone.now)
stub_analytics
allow(@analytics).to receive(:track_event)
end

it 'redirects to original path' do
put :create, params: { user: { password: 'wrong' } }

expect(response).to redirect_to idv_review_path

expect(@analytics).to have_received(:track_event).with(
'IdV: review complete',
success: false,
)
end
end

Expand All @@ -312,7 +319,10 @@ def show
it 'redirects to personal key path' do
put :create, params: { user: { password: ControllerHelper::VALID_PASSWORD } }

expect(@analytics).to have_received(:track_event).with('IdV: review complete')
expect(@analytics).to have_received(:track_event).with(
'IdV: review complete',
success: true,
)
expect(@analytics).to have_received(:track_event).with(
'IdV: final resolution',
success: true,
Expand Down