diff options
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 |