summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/ldap/user_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb
index 4ddf6b3039f..d232cb20759 100644
--- a/spec/lib/gitlab/ldap/user_spec.rb
+++ b/spec/lib/gitlab/ldap/user_spec.rb
@@ -35,4 +35,20 @@ describe Gitlab::LDAP::User do
expect{ gl_user.find_or_create(auth) }.to change{ User.count }.by(1)
end
end
+
+ describe "authenticate" do
+ let(:login) { 'john' }
+ let(:password) { 'my-secret' }
+
+ before {
+ Gitlab.config.ldap['enabled'] = true
+ Gitlab.config.ldap['user_filter'] = 'employeeType=developer'
+ }
+ after { Gitlab.config.ldap['enabled'] = false }
+
+ it "send an authentication request to ldap" do
+ expect( Gitlab::LDAP::User.adapter ).to receive(:bind_as)
+ Gitlab::LDAP::User.authenticate(login, password)
+ end
+ end
end