diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/features/profiles/two_factor_auths_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/features/profiles/two_factor_auths_spec.rb')
-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 |