diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/features/profiles/two_factor_auths_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.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 | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/spec/features/profiles/two_factor_auths_spec.rb b/spec/features/profiles/two_factor_auths_spec.rb index 3f5789e119a..a9256a73d7b 100644 --- a/spec/features/profiles/two_factor_auths_spec.rb +++ b/spec/features/profiles/two_factor_auths_spec.rb @@ -45,6 +45,19 @@ RSpec.describe 'Two factor auths' do expect(page).to have_content('Status: Enabled') end end + + context 'when invalid pin is provided' do + let_it_be(:user) { create(:omniauth_user) } + + it 'renders a error alert with a link to the troubleshooting section' do + visit profile_two_factor_auth_path + + fill_in 'pin_code', with: '123' + click_button 'Register with two-factor app' + + expect(page).to have_link('Try the troubleshooting steps here.', href: help_page_path('user/profile/account/two_factor_authentication.md', anchor: 'troubleshooting')) + end + end end context 'when user has two-factor authentication enabled' do @@ -57,7 +70,9 @@ RSpec.describe 'Two factor auths' do click_button 'Disable two-factor authentication' - page.accept_alert + page.within('[role="dialog"]') do + click_button 'Disable' + end expect(page).to have_content('You must provide a valid current password') @@ -65,7 +80,9 @@ RSpec.describe 'Two factor auths' do click_button 'Disable two-factor authentication' - page.accept_alert + page.within('[role="dialog"]') do + click_button 'Disable' + end expect(page).to have_content('Two-factor authentication has been disabled successfully!') expect(page).to have_content('Enable two-factor authentication') @@ -95,7 +112,9 @@ RSpec.describe 'Two factor auths' do click_button 'Disable two-factor authentication' - page.accept_alert + page.within('[role="dialog"]') do + click_button 'Disable' + end expect(page).to have_content('Two-factor authentication has been disabled successfully!') expect(page).to have_content('Enable two-factor authentication') |