diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 19333a38638..dbe3bd635d8 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -3766,13 +3766,22 @@ def multi_factor_auth( # Tracks when the the user has added the MFA method phone to their account # @param [Integer] enabled_mfa_methods_count number of registered mfa methods for the user # @param [Hash] recaptcha_annotation Details of reCAPTCHA annotation, if submitted - def multi_factor_auth_added_phone(enabled_mfa_methods_count:, recaptcha_annotation:, **extra) + # @param [Boolean] in_account_creation_flow whether user is going through creation flow + # @param ['phone'] method_name Authentication method added + def multi_factor_auth_added_phone( + enabled_mfa_methods_count:, + recaptcha_annotation:, + in_account_creation_flow:, + method_name: :phone, + **extra + ) track_event( 'Multi-Factor Authentication: Added phone', { - method_name: :phone, + method_name:, enabled_mfa_methods_count: enabled_mfa_methods_count, recaptcha_annotation:, + in_account_creation_flow:, **extra, }.compact, ) @@ -3798,12 +3807,17 @@ def multi_factor_auth_added_piv_cac(enabled_mfa_methods_count:, in_account_creat # Tracks when the user has added the MFA method TOTP to their account # @param [Integer] enabled_mfa_methods_count number of registered mfa methods for the user # @param [Boolean] in_account_creation_flow whether user is going through creation flow - def multi_factor_auth_added_totp(enabled_mfa_methods_count:, in_account_creation_flow:, - **extra) + # @param ['totp'] method_name Authentication method added + def multi_factor_auth_added_totp( + enabled_mfa_methods_count:, + in_account_creation_flow:, + method_name: :totp, + **extra + ) track_event( 'Multi-Factor Authentication: Added TOTP', { - method_name: :totp, + method_name:, in_account_creation_flow:, enabled_mfa_methods_count:, **extra, @@ -3995,6 +4009,16 @@ def multi_factor_auth_phone_setup( # @param [String] multi_factor_auth_method # @param [Boolean] in_account_creation_flow whether user is going through account creation flow # @param [integer] enabled_mfa_methods_count + # @param [DateTime] multi_factor_auth_method_created_at time auth method was created + # @param ['authentication','reauthentication','confirmation'] context User session context + # @param [Boolean] confirmation_for_add_phone Whether authenticating while adding phone + # @param [String] area_code Area code of phone number + # @param [String] country_code Country code associated with phone number + # @param [String] phone_fingerprint The hmac fingerprint of the phone number formatted as e164 + # @param [Integer] phone_configuration_id Database ID of phone configuration + # @param [Integer] auth_app_configuration_id Database ID of authentication app configuration + # @param [Boolean] totp_secret_present Whether TOTP secret was present in form validation + # @param [Boolean] new_device Whether the user is authenticating from a new device def multi_factor_auth_setup( success:, multi_factor_auth_method:, @@ -4002,17 +4026,39 @@ def multi_factor_auth_setup( in_account_creation_flow:, errors: nil, error_details: nil, + multi_factor_auth_method_created_at: nil, + context: nil, + confirmation_for_add_phone: nil, + area_code: nil, + country_code: nil, + phone_fingerprint: nil, + phone_configuration_id: nil, + totp_secret_present: nil, + auth_app_configuration_id: nil, + new_device: nil, **extra ) track_event( 'Multi-Factor Authentication Setup', - success:, - errors:, - error_details:, - multi_factor_auth_method:, - in_account_creation_flow:, - enabled_mfa_methods_count:, - **extra, + { + success:, + errors:, + error_details:, + multi_factor_auth_method:, + in_account_creation_flow:, + enabled_mfa_methods_count:, + multi_factor_auth_method_created_at:, + context:, + confirmation_for_add_phone:, + area_code:, + country_code:, + phone_fingerprint:, + phone_configuration_id:, + totp_secret_present:, + auth_app_configuration_id:, + new_device:, + **extra, + }.compact, ) end diff --git a/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb b/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb index b87fad16fbf..7995c514f20 100644 --- a/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb +++ b/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe TwoFactorAuthentication::OtpVerificationController, allowed_extra_analytics: [:*] do +RSpec.describe TwoFactorAuthentication::OtpVerificationController do describe '#show' do context 'when resource is not fully authenticated yet' do before do @@ -466,10 +466,19 @@ phone_configuration_created_at = controller.current_user. default_phone_configuration.created_at - properties = { + controller.user_session[:phone_id] = phone_id + + post( + :create, + params: { + code: subject.current_user.direct_otp, + otp_delivery_preference: 'sms', + }, + ) + + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: true, - errors: nil, - error_details: nil, confirmation_for_add_phone: true, context: 'confirmation', multi_factor_auth_method: 'sms', @@ -481,19 +490,7 @@ phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164), enabled_mfa_methods_count: 1, in_account_creation_flow: true, - } - - controller.user_session[:phone_id] = phone_id - - post( - :create, - params: { - code: subject.current_user.direct_otp, - otp_delivery_preference: 'sms', - }, ) - - expect(@analytics).to have_logged_event('Multi-Factor Authentication Setup', properties) end it 'resets otp session data' do @@ -547,27 +544,23 @@ end it 'tracks an event' do - phone_configuration_created_at = controller.current_user. - default_phone_configuration.created_at - - properties = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: false, - errors: nil, error_details: { code: { wrong_length: true, incorrect: true } }, confirmation_for_add_phone: true, context: 'confirmation', multi_factor_auth_method: 'sms', phone_configuration_id: controller.current_user.default_phone_configuration.id, - multi_factor_auth_method_created_at: phone_configuration_created_at.strftime('%s%L'), + multi_factor_auth_method_created_at: controller.current_user. + default_phone_configuration.created_at.strftime('%s%L'), new_device: true, area_code: parsed_phone.area_code, country_code: parsed_phone.country, phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164), enabled_mfa_methods_count: 1, in_account_creation_flow: false, - } - - expect(@analytics).to have_logged_event('Multi-Factor Authentication Setup', properties) + ) end context 'user enters in valid code after invalid entry' do @@ -618,26 +611,22 @@ it 'tracks the confirmation event' do parsed_phone = Phonelib.parse('+1 (703) 555-5555') - properties = { + + response + + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: true, - errors: nil, - error_details: nil, context: 'confirmation', multi_factor_auth_method: 'sms', - multi_factor_auth_method_created_at: nil, new_device: true, confirmation_for_add_phone: false, - phone_configuration_id: nil, area_code: parsed_phone.area_code, country_code: parsed_phone.country, phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164), enabled_mfa_methods_count: 0, in_account_creation_flow: false, - } - - response - - expect(@analytics).to have_logged_event('Multi-Factor Authentication Setup', properties) + ) expect(controller).to have_received(:create_user_event).with(:phone_confirmed) expect(controller).to have_received(:create_user_event).exactly(:once) diff --git a/spec/controllers/users/totp_setup_controller_spec.rb b/spec/controllers/users/totp_setup_controller_spec.rb index d3ff1a139c2..0d865fc2e1f 100644 --- a/spec/controllers/users/totp_setup_controller_spec.rb +++ b/spec/controllers/users/totp_setup_controller_spec.rb @@ -19,7 +19,6 @@ stub_analytics user = create(:user, :fully_registered, :with_phone, with: { phone: '703-555-1212' }) stub_sign_in(user) - allow(@analytics).to receive(:track_event) get :new end @@ -38,15 +37,13 @@ end it 'captures an analytics event' do - properties = { + expect(@analytics).to have_logged_event( + 'TOTP Setup Visited', user_signed_up: true, totp_secret_present: true, enabled_mfa_methods_count: 1, in_account_creation_flow: false, - } - - expect(@analytics). - to have_received(:track_event).with('TOTP Setup Visited', properties) + ) end end @@ -55,7 +52,6 @@ user = create(:user) stub_analytics stub_sign_in_before_2fa(user) - allow(@analytics).to receive(:track_event) get :new end @@ -74,15 +70,13 @@ end it 'captures an analytics event' do - properties = { + expect(@analytics).to have_logged_event( + 'TOTP Setup Visited', user_signed_up: false, totp_secret_present: true, enabled_mfa_methods_count: 0, in_account_creation_flow: false, - } - - expect(@analytics). - to have_received(:track_event).with('TOTP Setup Visited', properties) + ) end end end @@ -96,7 +90,6 @@ user = build(:user, personal_key: 'ABCD-DEFG-HIJK-LMNO') stub_sign_in(user) stub_analytics - allow(@analytics).to receive(:track_event) subject.user_session[:new_totp_secret] = 'abcdehij' patch :confirm, params: { name: name, code: 123 } @@ -107,20 +100,15 @@ expect(flash[:error]).to eq t('errors.invalid_totp') expect(subject.current_user.auth_app_configurations.any?).to eq false - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: false, errors: {}, - error_details: nil, totp_secret_present: true, multi_factor_auth_method: 'totp', - auth_app_configuration_id: nil, enabled_mfa_methods_count: 0, in_account_creation_flow: false, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end @@ -130,7 +118,6 @@ secret = ROTP::Base32.random_base32 stub_sign_in(user) stub_analytics - allow(@analytics).to receive(:track_event) subject.user_session[:new_totp_secret] = secret patch :confirm, params: { name: name, code: generate_totp_code(secret) } @@ -140,20 +127,16 @@ expect(response).to redirect_to(account_path) expect(subject.user_session[:new_totp_secret]).to be_nil - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: true, errors: {}, - error_details: nil, totp_secret_present: true, multi_factor_auth_method: 'totp', auth_app_configuration_id: next_auth_app_id, enabled_mfa_methods_count: 2, in_account_creation_flow: false, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end @@ -163,7 +146,6 @@ secret = ROTP::Base32.random_base32 stub_sign_in(user) stub_analytics - allow(@analytics).to receive(:track_event) subject.user_session[:new_totp_secret] = secret patch :confirm, params: { name: name } @@ -174,20 +156,15 @@ expect(flash[:error]).to eq t('errors.invalid_totp') expect(subject.current_user.auth_app_configurations.any?).to eq false - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: false, errors: {}, - error_details: nil, totp_secret_present: true, multi_factor_auth_method: 'totp', - auth_app_configuration_id: nil, enabled_mfa_methods_count: 1, in_account_creation_flow: false, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end @@ -197,7 +174,6 @@ secret = ROTP::Base32.random_base32 stub_sign_in(user) stub_analytics - allow(@analytics).to receive(:track_event) subject.user_session[:new_totp_secret] = secret patch :confirm, params: { code: generate_totp_code(secret) } @@ -208,20 +184,16 @@ expect(flash[:error]).to eq t('errors.invalid_totp') expect(subject.current_user.auth_app_configurations.any?).to eq false - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: false, error_details: { name: { blank: true } }, errors: { name: [t('errors.messages.blank')] }, totp_secret_present: true, multi_factor_auth_method: 'totp', - auth_app_configuration_id: nil, enabled_mfa_methods_count: 1, in_account_creation_flow: false, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end end @@ -231,7 +203,6 @@ before do stub_sign_in_before_2fa stub_analytics - allow(@analytics).to receive(:track_event) subject.user_session[:new_totp_secret] = 'abcdehij' patch :confirm, params: { name: name, code: 123 } @@ -242,19 +213,15 @@ expect(flash[:error]).to eq t('errors.invalid_totp') expect(subject.current_user.auth_app_configurations.any?).to eq false - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: false, errors: {}, - error_details: nil, totp_secret_present: true, multi_factor_auth_method: 'totp', - auth_app_configuration_id: nil, enabled_mfa_methods_count: 0, in_account_creation_flow: false, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end @@ -264,7 +231,6 @@ secret = ROTP::Base32.random_base32 stub_sign_in_before_2fa stub_analytics - allow(@analytics).to receive(:track_event) subject.user_session[:new_totp_secret] = secret subject.user_session[:mfa_selections] = mfa_selections subject.user_session[:in_account_creation_flow] = true @@ -277,20 +243,16 @@ expect(response).to redirect_to(auth_method_confirmation_path) expect(subject.user_session[:new_totp_secret]).to be_nil - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: true, errors: {}, - error_details: nil, totp_secret_present: true, multi_factor_auth_method: 'totp', auth_app_configuration_id: next_auth_app_id, enabled_mfa_methods_count: 1, in_account_creation_flow: true, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end @@ -300,20 +262,16 @@ it 'redirects to next mfa path with a success message and still logs analytics' do expect(response).to redirect_to(phone_setup_url) - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: true, errors: {}, - error_details: nil, totp_secret_present: true, multi_factor_auth_method: 'totp', auth_app_configuration_id: next_auth_app_id, enabled_mfa_methods_count: 1, in_account_creation_flow: true, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end end @@ -322,7 +280,6 @@ before do stub_sign_in_before_2fa stub_analytics - allow(@analytics).to receive(:track_event) patch :confirm, params: { name: name, code: 123 } end @@ -332,20 +289,15 @@ expect(flash[:error]).to eq t('errors.invalid_totp') expect(subject.current_user.auth_app_configurations.any?).to eq false - result = { + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', success: false, errors: {}, - error_details: nil, totp_secret_present: false, multi_factor_auth_method: 'totp', - auth_app_configuration_id: nil, enabled_mfa_methods_count: 0, in_account_creation_flow: false, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - - expect(@analytics).to have_received(:track_event). - with('Multi-Factor Authentication Setup', result) + ) end end end diff --git a/spec/controllers/users/webauthn_setup_controller_spec.rb b/spec/controllers/users/webauthn_setup_controller_spec.rb index b0045caa5a0..434ad532ff5 100644 --- a/spec/controllers/users/webauthn_setup_controller_spec.rb +++ b/spec/controllers/users/webauthn_setup_controller_spec.rb @@ -97,7 +97,15 @@ it 'tracks the submission' do Funnel::Registration::AddMfa.call(user.id, 'phone', @analytics) - result = { + + patch :confirm, params: params + + expect(@analytics).to have_logged_event( + 'User marked authenticated', + authentication_type: :valid_2fa_confirmation, + ) + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', enabled_mfa_methods_count: 3, mfa_method_counts: { auth_app: 1, phone: 1, webauthn: 1 @@ -105,7 +113,6 @@ multi_factor_auth_method: 'webauthn', success: true, errors: {}, - error_details: nil, in_account_creation_flow: false, authenticator_data_flags: { up: true, @@ -115,22 +122,13 @@ at: true, ed: false, }, - pii_like_keypaths: [[:mfa_method_counts, :phone]], - } - expect(@analytics).to receive(:track_event). - with('User marked authenticated', { authentication_type: :valid_2fa_confirmation }) - expect(@analytics).to receive(:track_event). - with('Multi-Factor Authentication Setup', result) - - expect(@analytics).to receive(:track_event). - with( - :webauthn_setup_submitted, - errors: nil, - platform_authenticator: false, - success: true, - ) - - patch :confirm, params: params + ) + expect(@analytics).to have_logged_event( + :webauthn_setup_submitted, + platform_authenticator: false, + success: true, + errors: nil, + ) end end end @@ -238,31 +236,28 @@ it 'should log expected events' do Funnel::Registration::AddMfa.call(user.id, 'phone', @analytics) - expect(@analytics).to receive(:track_event). - with('User marked authenticated', { authentication_type: :valid_2fa_confirmation }) - expect(@analytics).to receive(:track_event).with( - 'Multi-Factor Authentication Setup', - { - enabled_mfa_methods_count: 1, - errors: {}, - error_details: nil, - in_account_creation_flow: true, - mfa_method_counts: { webauthn: 1 }, - multi_factor_auth_method: 'webauthn', - pii_like_keypaths: [[:mfa_method_counts, :phone]], - success: true, - }, - ) - - expect(@analytics).to receive(:track_event). - with( - :webauthn_setup_submitted, - errors: nil, - platform_authenticator: false, - success: true, - ) patch :confirm, params: params + + expect(@analytics).to have_logged_event( + 'User marked authenticated', + authentication_type: :valid_2fa_confirmation, + ) + expect(@analytics).to have_logged_event( + 'Multi-Factor Authentication Setup', + enabled_mfa_methods_count: 1, + errors: {}, + in_account_creation_flow: true, + mfa_method_counts: { webauthn: 1 }, + multi_factor_auth_method: 'webauthn', + success: true, + ) + expect(@analytics).to have_logged_event( + :webauthn_setup_submitted, + errors: nil, + platform_authenticator: false, + success: true, + ) end end @@ -293,36 +288,31 @@ end it 'should log expected events' do - expect(@analytics).to receive(:track_event). - with( - :webauthn_setup_submitted, - errors: nil, - platform_authenticator: true, - success: true, - ) + patch :confirm, params: params - expect(@analytics).to receive(:track_event). - with('User marked authenticated', { authentication_type: :valid_2fa_confirmation }) - expect(@analytics).to receive(:track_event).with( + expect(@analytics).to have_logged_event( + :webauthn_setup_submitted, + errors: nil, + platform_authenticator: true, + success: true, + ) + expect(@analytics).to have_logged_event( + 'User marked authenticated', + authentication_type: :valid_2fa_confirmation, + ) + expect(@analytics).to have_logged_event( 'User Registration: User Fully Registered', - { mfa_method: 'webauthn_platform' }, + mfa_method: 'webauthn_platform', ) - - expect(@analytics).to receive(:track_event).with( + expect(@analytics).to have_logged_event( 'Multi-Factor Authentication Setup', - { - enabled_mfa_methods_count: 1, - errors: {}, - error_details: nil, - in_account_creation_flow: true, - mfa_method_counts: { webauthn_platform: 1 }, - multi_factor_auth_method: 'webauthn_platform', - pii_like_keypaths: [[:mfa_method_counts, :phone]], - success: true, - }, + enabled_mfa_methods_count: 1, + errors: {}, + in_account_creation_flow: true, + mfa_method_counts: { webauthn_platform: 1 }, + multi_factor_auth_method: 'webauthn_platform', + success: true, ) - - patch :confirm, params: params end it 'should log submitted failure' do diff --git a/spec/features/account_creation/multiple_browsers_spec.rb b/spec/features/account_creation/multiple_browsers_spec.rb index 0a4b6c5d2da..73080c84394 100644 --- a/spec/features/account_creation/multiple_browsers_spec.rb +++ b/spec/features/account_creation/multiple_browsers_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'account creation across multiple browsers', allowed_extra_analytics: [:*] do +RSpec.feature 'account creation across multiple browsers' do include SpAuthHelper include SamlAuthHelper include OidcAuthHelper diff --git a/spec/features/account_creation/sp_return_log_spec.rb b/spec/features/account_creation/sp_return_log_spec.rb index aaba214caf7..2513b1fda4b 100644 --- a/spec/features/account_creation/sp_return_log_spec.rb +++ b/spec/features/account_creation/sp_return_log_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'SP return logs', allowed_extra_analytics: [:*] do +RSpec.feature 'SP return logs' do include SamlAuthHelper let(:email) { 'test@test.com' } diff --git a/spec/features/new_device_tracking_spec.rb b/spec/features/new_device_tracking_spec.rb index b5e36214643..a64a8e1179f 100644 --- a/spec/features/new_device_tracking_spec.rb +++ b/spec/features/new_device_tracking_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'New device tracking', allowed_extra_analytics: [:*] do +RSpec.describe 'New device tracking' do include SamlAuthHelper let(:user) { create(:user, :fully_registered) } diff --git a/spec/features/openid_connect/authorization_confirmation_spec.rb b/spec/features/openid_connect/authorization_confirmation_spec.rb index 4a8347938b0..d7da4869098 100644 --- a/spec/features/openid_connect/authorization_confirmation_spec.rb +++ b/spec/features/openid_connect/authorization_confirmation_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'OIDC Authorization Confirmation', allowed_extra_analytics: [:*] do +RSpec.feature 'OIDC Authorization Confirmation' do include OidcAuthHelper before do diff --git a/spec/features/phone/add_phone_spec.rb b/spec/features/phone/add_phone_spec.rb index 1320ad23a39..c95e98579aa 100644 --- a/spec/features/phone/add_phone_spec.rb +++ b/spec/features/phone/add_phone_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'Add a new phone number', allowed_extra_analytics: [:*] do +RSpec.describe 'Add a new phone number' do scenario 'Adding and confirming a new phone number allows the phone number to be used for MFA' do user = create(:user, :fully_registered) phone = '+1 (225) 278-1234' diff --git a/spec/features/phone/confirmation_spec.rb b/spec/features/phone/confirmation_spec.rb index 678cb6b5819..04478724e63 100644 --- a/spec/features/phone/confirmation_spec.rb +++ b/spec/features/phone/confirmation_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'phone otp confirmation', allowed_extra_analytics: [:*] do +RSpec.describe 'phone otp confirmation' do let(:phone) { '2025551234' } let(:formatted_phone) { PhoneFormatter.format(phone) } diff --git a/spec/features/phone/default_phone_selection_spec.rb b/spec/features/phone/default_phone_selection_spec.rb index f87c3e58cc2..40340bda191 100644 --- a/spec/features/phone/default_phone_selection_spec.rb +++ b/spec/features/phone/default_phone_selection_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'default phone selection', allowed_extra_analytics: [:*] do +RSpec.describe 'default phone selection' do let(:user) { create(:user, :with_phone) } let(:phone_config2) do create( diff --git a/spec/features/phone/rate_limiting_spec.rb b/spec/features/phone/rate_limiting_spec.rb index 36e82855d2a..9bf8c3dc3a6 100644 --- a/spec/features/phone/rate_limiting_spec.rb +++ b/spec/features/phone/rate_limiting_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'phone rate limiting', allowed_extra_analytics: [:*] do +RSpec.describe 'phone rate limiting' do let(:phone) { '2025551234' } context 'on sign up' do diff --git a/spec/features/remember_device/phone_spec.rb b/spec/features/remember_device/phone_spec.rb index 54e7bbbc8e9..5b16b37a8af 100644 --- a/spec/features/remember_device/phone_spec.rb +++ b/spec/features/remember_device/phone_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'Remembering a phone', allowed_extra_analytics: [:*] do +RSpec.feature 'Remembering a phone' do include IdvStepHelper before do diff --git a/spec/features/remember_device/signed_in_sp_expiration_spec.rb b/spec/features/remember_device/signed_in_sp_expiration_spec.rb index 57246264d93..034cde39285 100644 --- a/spec/features/remember_device/signed_in_sp_expiration_spec.rb +++ b/spec/features/remember_device/signed_in_sp_expiration_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'SP expiration while signed in', allowed_extra_analytics: [:*] do +RSpec.feature 'SP expiration while signed in' do include SamlAuthHelper ## diff --git a/spec/features/remember_device/sp_expiration_spec.rb b/spec/features/remember_device/sp_expiration_spec.rb index 525a21008d4..99af39df96f 100644 --- a/spec/features/remember_device/sp_expiration_spec.rb +++ b/spec/features/remember_device/sp_expiration_spec.rb @@ -83,7 +83,7 @@ def visit_sp(protocol, aal) end end -RSpec.feature 'remember device sp expiration', allowed_extra_analytics: [:*] do +RSpec.feature 'remember device sp expiration' do include SamlAuthHelper aal1_remember_device_expiration = diff --git a/spec/features/remember_device/totp_spec.rb b/spec/features/remember_device/totp_spec.rb index 005f83b0600..f3de6d554bc 100644 --- a/spec/features/remember_device/totp_spec.rb +++ b/spec/features/remember_device/totp_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'Remembering a TOTP device', allowed_extra_analytics: [:*] do +RSpec.describe 'Remembering a TOTP device' do before do allow(IdentityConfig.store).to receive(:otp_delivery_blocklist_maxretry).and_return(1000) end diff --git a/spec/features/saml/authorization_confirmation_spec.rb b/spec/features/saml/authorization_confirmation_spec.rb index 9771877c953..a9e075f2ad6 100644 --- a/spec/features/saml/authorization_confirmation_spec.rb +++ b/spec/features/saml/authorization_confirmation_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'SAML Authorization Confirmation', allowed_extra_analytics: [:*] do +RSpec.feature 'SAML Authorization Confirmation' do include SamlAuthHelper before do diff --git a/spec/features/saml/ial1_sso_spec.rb b/spec/features/saml/ial1_sso_spec.rb index 24a49e5fa04..e2ca596dfe9 100644 --- a/spec/features/saml/ial1_sso_spec.rb +++ b/spec/features/saml/ial1_sso_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'IAL1 Single Sign On', allowed_extra_analytics: [:*] do +RSpec.feature 'IAL1 Single Sign On' do include SamlAuthHelper context 'First time registration', email: true do diff --git a/spec/features/two_factor_authentication/change_factor_spec.rb b/spec/features/two_factor_authentication/change_factor_spec.rb index d1260108e04..1d49e668fcd 100644 --- a/spec/features/two_factor_authentication/change_factor_spec.rb +++ b/spec/features/two_factor_authentication/change_factor_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'Changing authentication factor', allowed_extra_analytics: [:*] do +RSpec.feature 'Changing authentication factor' do describe 'requires re-authenticating' do let(:user) { sign_up_and_2fa_ial1_user } diff --git a/spec/features/users/sign_up_spec.rb b/spec/features/users/sign_up_spec.rb index 511bc96b06e..838fd62a7f4 100644 --- a/spec/features/users/sign_up_spec.rb +++ b/spec/features/users/sign_up_spec.rb @@ -121,8 +121,6 @@ expect(fake_analytics).to have_logged_event( 'Multi-Factor Authentication Setup', success: true, - errors: nil, - error_details: nil, multi_factor_auth_method: 'backup_codes', in_account_creation_flow: true, enabled_mfa_methods_count: 2, diff --git a/spec/features/users/totp_management_spec.rb b/spec/features/users/totp_management_spec.rb index 3e68beef5be..aabca5c1c97 100644 --- a/spec/features/users/totp_management_spec.rb +++ b/spec/features/users/totp_management_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'totp management', allowed_extra_analytics: [:*] do +RSpec.describe 'totp management' do context 'when the user has totp enabled' do let(:user) { create(:user, :fully_registered, :with_authentication_app) } diff --git a/spec/features/visitors/email_confirmation_spec.rb b/spec/features/visitors/email_confirmation_spec.rb index ab984f0a983..1925545deca 100644 --- a/spec/features/visitors/email_confirmation_spec.rb +++ b/spec/features/visitors/email_confirmation_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'Email confirmation during sign up', allowed_extra_analytics: [:*] do +RSpec.feature 'Email confirmation during sign up' do it 'requires user to accept rules of use when registering email' do visit sign_up_email_path fill_in t('forms.registration.labels.email'), with: 'test@example.com' diff --git a/spec/features/visitors/sign_up_with_email_spec.rb b/spec/features/visitors/sign_up_with_email_spec.rb index 1459feb84b5..409b324821f 100644 --- a/spec/features/visitors/sign_up_with_email_spec.rb +++ b/spec/features/visitors/sign_up_with_email_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'Visitor signs up with email address', allowed_extra_analytics: [:*] do +RSpec.feature 'Visitor signs up with email address' do scenario 'visitor can sign up with valid email address' do email = 'test@example.com' sign_up_with(email)