diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-07 00:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-07 00:09:01 +0300 |
commit | ca3ff7f842fb1e4bf124356a6faccd3e65b7aba3 (patch) | |
tree | befb345c84e172b0592378ca17298f7a0c955a06 /spec/features | |
parent | 1287690a3678ad0ec21c9b2f3b21ae18257d5e22 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/profiles/password_spec.rb | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index 1d0db488751..6c860740354 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -51,11 +51,11 @@ RSpec.describe 'Profile > Password' do end context 'Password authentication unavailable' do - before do - gitlab_sign_in(user) - end - context 'Regular user' do + before do + gitlab_sign_in(user) + end + let(:user) { create(:user) } it 'renders 404 when password authentication is disabled for the web interface and Git' do @@ -69,7 +69,22 @@ RSpec.describe 'Profile > Password' do end context 'LDAP user' do + include LdapHelpers + + let(:ldap_settings) { { enabled: true } } let(:user) { create(:omniauth_user, provider: 'ldapmain') } + let(:provider) { 'ldapmain' } + let(:provider_label) { 'Main LDAP' } + + before do + stub_ldap_setting(ldap_settings) + stub_ldap_access(user, provider, provider_label) + sign_in_using_ldap!(user, provider_label, provider) + end + + after(:all) do + Rails.application.reload_routes! + end it 'renders 404' do visit edit_profile_password_path |