提交 f27830fa 编写于 作者: J Jan-Willem van der Meer

Ensure Gitlab::LDAP::authentication is tested

上级 f88b6d03
......@@ -26,5 +26,22 @@ describe Gitlab::Auth do
user = 'wrong'
expect( gl_auth.find(username, password) ).to_not eql user
end
context "with ldap enabled" do
before { Gitlab.config.ldap['enabled'] = true }
after { Gitlab.config.ldap['enabled'] = false }
it "tries to autheticate with db before ldap" do
expect(Gitlab::LDAP::User).not_to receive(:authenticate)
gl_auth.find(username, password)
end
it "uses ldap as fallback to for authentication" do
expect(Gitlab::LDAP::User).to receive(:authenticate)
gl_auth.find('ldap_user', 'password')
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册