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
9 changes: 1 addition & 8 deletions app/controllers/concerns/rate_limit_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ def rate_limit_redirect!(rate_limit_type)

def track_rate_limited_event(rate_limit_type)
analytics_args = { limiter_type: rate_limit_type }
limiter_context = 'single-session'

if rate_limit_type == :proof_address
analytics_args[:step_name] = :phone
elsif rate_limit_type == :proof_ssn
analytics_args[:step_name] = 'verify_info'
limiter_context = 'multi-session'
end
limiter_context = rate_limit_type == :proof_ssn ? 'multi-session' : 'single-session'

irs_attempts_api_tracker.idv_verification_rate_limited(limiter_context: limiter_context)
analytics.rate_limit_reached(**analytics_args)
Expand Down
1 change: 0 additions & 1 deletion spec/controllers/idv/phone_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@
'Rate Limit Reached',
{
limiter_type: :proof_address,
step_name: :phone,
},
)
end
Expand Down
9 changes: 4 additions & 5 deletions spec/controllers/idv_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe IdvController, allowed_extra_analytics: [:*] do
RSpec.describe IdvController do
before do
stub_sign_in
end
Expand All @@ -12,19 +12,18 @@
end

it 'tracks page visit' do
expect(@analytics).to receive(:track_event).with(analytics_name)

get :index
expect(@analytics).to have_logged_event(analytics_name)
end

it 'does not track page visit if profile is active' do
profile = create(:profile, :active, :verified)

stub_sign_in(profile.user)

expect(@analytics).to_not receive(:track_event).with(analytics_name)

get :index

expect(@analytics).not_to have_logged_event(analytics_name)
end

it 'redirects to please call page if fraud review is pending' do
Expand Down