diff options
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/profiles/two_factor_auths_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/features/profiles/two_factor_auths_spec.rb b/spec/features/profiles/two_factor_auths_spec.rb index 9a58950b8f3..b4355f2d669 100644 --- a/spec/features/profiles/two_factor_auths_spec.rb +++ b/spec/features/profiles/two_factor_auths_spec.rb @@ -6,6 +6,8 @@ RSpec.describe 'Two factor auths' do include Spec::Support::Helpers::ModalHelpers context 'when signed in' do + let(:invalid_current_pwd_msg) { 'You must provide a valid current password' } + before do sign_in(user) end @@ -18,7 +20,7 @@ RSpec.describe 'Two factor auths' do register_2fa(user.current_otp, '123') - expect(page).to have_content('You must provide a valid current password') + expect(page).to have_selector('.gl-alert-title', text: invalid_current_pwd_msg, count: 1) register_2fa(user.reload.current_otp, user.password) @@ -76,7 +78,7 @@ RSpec.describe 'Two factor auths' do click_button 'Disable' end - expect(page).to have_content('You must provide a valid current password') + expect(page).to have_selector('.gl-alert-title', text: invalid_current_pwd_msg, count: 1) fill_in 'current_password', with: user.password @@ -97,7 +99,7 @@ RSpec.describe 'Two factor auths' do click_button 'Regenerate recovery codes' - expect(page).to have_content('You must provide a valid current password') + expect(page).to have_selector('.gl-alert-title', text: invalid_current_pwd_msg, count: 1) fill_in 'current_password', with: user.password |