diff options
Diffstat (limited to 'spec/support/helpers/ldap_helpers.rb')
-rw-r--r-- | spec/support/helpers/ldap_helpers.rb | 24 |
1 files changed, 12 insertions, 12 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 |