diff --git a/app/controllers/concerns/rate_limit_concern.rb b/app/controllers/concerns/rate_limit_concern.rb index 0f082a8b0c1..cb46d134e7b 100644 --- a/app/controllers/concerns/rate_limit_concern.rb +++ b/app/controllers/concerns/rate_limit_concern.rb @@ -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) diff --git a/spec/controllers/idv/phone_controller_spec.rb b/spec/controllers/idv/phone_controller_spec.rb index f2d72850cd2..2c86e94a43e 100644 --- a/spec/controllers/idv/phone_controller_spec.rb +++ b/spec/controllers/idv/phone_controller_spec.rb @@ -578,7 +578,6 @@ 'Rate Limit Reached', { limiter_type: :proof_address, - step_name: :phone, }, ) end diff --git a/spec/controllers/idv_controller_spec.rb b/spec/controllers/idv_controller_spec.rb index 414b2222332..e12238f6b31 100644 --- a/spec/controllers/idv_controller_spec.rb +++ b/spec/controllers/idv_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe IdvController, allowed_extra_analytics: [:*] do +RSpec.describe IdvController do before do stub_sign_in end @@ -12,9 +12,8 @@ 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 @@ -22,9 +21,9 @@ 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