diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 13:18:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 13:18:24 +0000 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/features/users/login_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) | |
download | gitlab-ce-0653e08efd039a5905f3fa4f6e9cef9f5d2f799c.tar.gz |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/features/users/login_spec.rb')
-rw-r--r-- | spec/features/users/login_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb index 6c38d5d8b24..afd750d02eb 100644 --- a/spec/features/users/login_spec.rb +++ b/spec/features/users/login_spec.rb @@ -2,9 +2,10 @@ require 'spec_helper' -RSpec.describe 'Login' do +RSpec.describe 'Login', :clean_gitlab_redis_shared_state do include TermsHelper include UserLoginHelper + include SessionHelpers before do stub_authentication_activity_metrics(debug: true) @@ -59,6 +60,7 @@ RSpec.describe 'Login' do fill_in 'user_password', with: 'password' click_button 'Sign in' + expect_single_session_with_authenticated_ttl expect(current_path).to eq root_path end @@ -192,6 +194,7 @@ RSpec.describe 'Login' do enter_code(user.current_otp) expect(page).not_to have_content(I18n.t('devise.failure.already_authenticated')) + expect_single_session_with_authenticated_ttl end it 'does not allow sign-in if the user password is updated before entering a one-time code' do @@ -210,6 +213,7 @@ RSpec.describe 'Login' do enter_code(user.current_otp) + expect_single_session_with_authenticated_ttl expect(current_path).to eq root_path end @@ -237,6 +241,8 @@ RSpec.describe 'Login' do expect(page).to have_content('Invalid two-factor code') enter_code(user.current_otp) + + expect_single_session_with_authenticated_ttl expect(current_path).to eq root_path end @@ -353,6 +359,7 @@ RSpec.describe 'Login' do sign_in_using_saml! + expect_single_session_with_authenticated_ttl expect(page).not_to have_content('Two-Factor Authentication') expect(current_path).to eq root_path end @@ -371,6 +378,7 @@ RSpec.describe 'Login' do enter_code(user.current_otp) + expect_single_session_with_authenticated_ttl expect(current_path).to eq root_path end end @@ -391,6 +399,7 @@ RSpec.describe 'Login' do gitlab_sign_in(user) + expect_single_session_with_authenticated_ttl expect(current_path).to eq root_path expect(page).not_to have_content(I18n.t('devise.failure.already_authenticated')) end @@ -402,6 +411,7 @@ RSpec.describe 'Login' do gitlab_sign_in(user) visit new_user_session_path + expect_single_session_with_authenticated_ttl expect(page).not_to have_content(I18n.t('devise.failure.already_authenticated')) end @@ -443,6 +453,7 @@ RSpec.describe 'Login' do gitlab_sign_in(user) + expect_single_session_with_short_ttl expect(page).to have_content('Invalid login or password.') end end |