diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 18:09:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 18:09:39 +0300 |
commit | dc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch) | |
tree | 70945aa6721a271fc8057efa13c3216a03fbac45 /spec/support | |
parent | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/ldap_helpers.rb | 24 | ||||
-rw-r--r-- | spec/support/shared_contexts/controllers/ldap_omniauth_callbacks_controller_shared_context.rb | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/spec/support/helpers/ldap_helpers.rb b/spec/support/helpers/ldap_helpers.rb index 0549c56c753..8154e3a4fc9 100644 --- a/spec/support/helpers/ldap_helpers.rb +++ b/spec/support/helpers/ldap_helpers.rb @@ -2,14 +2,14 @@ module LdapHelpers def ldap_adapter(provider = 'ldapmain', ldap = double(:ldap)) - ::Gitlab::Auth::LDAP::Adapter.new(provider, ldap) + ::Gitlab::Auth::Ldap::Adapter.new(provider, ldap) end def user_dn(uid) "uid=#{uid},ou=users,dc=example,dc=com" end - # Accepts a hash of Gitlab::Auth::LDAP::Config keys and values. + # Accepts a hash of Gitlab::Auth::Ldap::Config keys and values. # # Example: # stub_ldap_config( @@ -17,7 +17,7 @@ module LdapHelpers # admin_group: 'my-admin-group' # ) def stub_ldap_config(messages) - allow_any_instance_of(::Gitlab::Auth::LDAP::Config).to receive_messages(messages) + allow_any_instance_of(::Gitlab::Auth::Ldap::Config).to receive_messages(messages) end def stub_ldap_setting(messages) @@ -28,29 +28,29 @@ module LdapHelpers # `entry` to simulate when an LDAP person is not found # # Example: - # adapter = ::Gitlab::Auth::LDAP::Adapter.new('ldapmain', double(:ldap)) + # adapter = ::Gitlab::Auth::Ldap::Adapter.new('ldapmain', double(:ldap)) # ldap_user_entry = ldap_user_entry('john_doe') # # stub_ldap_person_find_by_uid('john_doe', ldap_user_entry, adapter) def stub_ldap_person_find_by_uid(uid, entry, provider = 'ldapmain') - return_value = ::Gitlab::Auth::LDAP::Person.new(entry, provider) if entry.present? + return_value = ::Gitlab::Auth::Ldap::Person.new(entry, provider) if entry.present? - allow(::Gitlab::Auth::LDAP::Person) + allow(::Gitlab::Auth::Ldap::Person) .to receive(:find_by_uid).with(uid, any_args).and_return(return_value) end def stub_ldap_person_find_by_dn(entry, provider = 'ldapmain') - person = ::Gitlab::Auth::LDAP::Person.new(entry, provider) if entry.present? + person = ::Gitlab::Auth::Ldap::Person.new(entry, provider) if entry.present? - allow(::Gitlab::Auth::LDAP::Person) + allow(::Gitlab::Auth::Ldap::Person) .to receive(:find_by_dn) .and_return(person) end def stub_ldap_person_find_by_email(email, entry, provider = 'ldapmain') - person = ::Gitlab::Auth::LDAP::Person.new(entry, provider) if entry.present? + person = ::Gitlab::Auth::Ldap::Person.new(entry, provider) if entry.present? - allow(::Gitlab::Auth::LDAP::Person) + allow(::Gitlab::Auth::Ldap::Person) .to receive(:find_by_email) .with(email, anything) .and_return(person) @@ -66,8 +66,8 @@ module LdapHelpers end def raise_ldap_connection_error - allow_any_instance_of(Gitlab::Auth::LDAP::Adapter) - .to receive(:ldap_search).and_raise(Gitlab::Auth::LDAP::LDAPConnectionError) + allow_any_instance_of(Gitlab::Auth::Ldap::Adapter) + .to receive(:ldap_search).and_raise(Gitlab::Auth::Ldap::LdapConnectionError) end end diff --git a/spec/support/shared_contexts/controllers/ldap_omniauth_callbacks_controller_shared_context.rb b/spec/support/shared_contexts/controllers/ldap_omniauth_callbacks_controller_shared_context.rb index 4426d3af908..8635c9a8ff9 100644 --- a/spec/support/shared_contexts/controllers/ldap_omniauth_callbacks_controller_shared_context.rb +++ b/spec/support/shared_contexts/controllers/ldap_omniauth_callbacks_controller_shared_context.rb @@ -30,7 +30,7 @@ RSpec.shared_context 'Ldap::OmniauthCallbacksController' do @original_env_config_omniauth_auth = mock_auth_hash(provider.to_s, uid, user.email) stub_omniauth_provider(provider, context: request) - allow(Gitlab::Auth::LDAP::Access).to receive(:allowed?).and_return(valid_login?) + allow(Gitlab::Auth::Ldap::Access).to receive(:allowed?).and_return(valid_login?) end after do |