diff options
Diffstat (limited to 'spec/features/users/login_spec.rb')
-rw-r--r-- | spec/features/users/login_spec.rb | 67 |
1 files changed, 16 insertions, 51 deletions
diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb index e4a8d836413..5a537c1d4df 100644 --- a/spec/features/users/login_spec.rb +++ b/spec/features/users/login_spec.rb @@ -742,65 +742,30 @@ RSpec.describe 'Login' do end context 'when the user did not enable 2FA' do - context 'when `vue_2fa_recovery_codes` feature flag is disabled' do - before do - stub_feature_flags(vue_2fa_recovery_codes: false) - end - - it 'asks to set 2FA before asking to accept the terms' do - expect(authentication_metrics) - .to increment(:user_authenticated_counter) - - visit new_user_session_path - - fill_in 'user_login', with: user.email - fill_in 'user_password', with: '12345678' - - click_button 'Sign in' - - expect_to_be_on_terms_page - click_button 'Accept terms' - - expect(current_path).to eq(profile_two_factor_auth_path) - - fill_in 'pin_code', with: user.reload.current_otp - - click_button 'Register with two-factor app' - - expect(page).to have_content('Congratulations! You have enabled Two-factor Authentication!') - - click_link 'Proceed' - - expect(current_path).to eq(profile_account_path) - end - end - - context 'when `vue_2fa_recovery_codes` feature flag is enabled' do - it 'asks to set 2FA before asking to accept the terms', :js do - expect(authentication_metrics) - .to increment(:user_authenticated_counter) + it 'asks to set 2FA before asking to accept the terms', :js do + expect(authentication_metrics) + .to increment(:user_authenticated_counter) - visit new_user_session_path + visit new_user_session_path - fill_in 'user_login', with: user.email - fill_in 'user_password', with: '12345678' + fill_in 'user_login', with: user.email + fill_in 'user_password', with: '12345678' - click_button 'Sign in' + click_button 'Sign in' - expect_to_be_on_terms_page - click_button 'Accept terms' + expect_to_be_on_terms_page + click_button 'Accept terms' - expect(current_path).to eq(profile_two_factor_auth_path) + expect(current_path).to eq(profile_two_factor_auth_path) - fill_in 'pin_code', with: user.reload.current_otp + fill_in 'pin_code', with: user.reload.current_otp - click_button 'Register with two-factor app' - click_button 'Copy codes' - click_link 'Proceed' + click_button 'Register with two-factor app' + click_button 'Copy codes' + click_link 'Proceed' - expect(current_path).to eq(profile_account_path) - expect(page).to have_content('Congratulations! You have enabled Two-factor Authentication!') - end + expect(current_path).to eq(profile_account_path) + expect(page).to have_content('Congratulations! You have enabled Two-factor Authentication!') end end |