diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-10-23 22:57:16 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-10-23 22:57:16 +0200 |
commit | 472a6621e969f3b74fa21325722e65f446912f2a (patch) | |
tree | 9903ec11e50f5c07d5d4d13221890572cca20d0b /spec/lib | |
parent | 1c1d9f78a4d7e569fda4ee70603a7bc2472a4ae4 (diff) | |
download | gitlab-ce-472a6621e969f3b74fa21325722e65f446912f2a.tar.gz |
Fix LDAP config lookup for provider 'ldap'
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/ldap/config_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/lib/gitlab/ldap/config_spec.rb b/spec/lib/gitlab/ldap/config_spec.rb index 76cc7f95c47..3ebb8aae243 100644 --- a/spec/lib/gitlab/ldap/config_spec.rb +++ b/spec/lib/gitlab/ldap/config_spec.rb @@ -16,5 +16,19 @@ describe Gitlab::LDAP::Config do it "raises an error if a unknow provider is used" do expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error end + + context "if 'ldap' is the provider name" do + let(:provider) { 'ldap' } + + context "and 'ldap' is not in defined as a provider" do + before { Gitlab::LDAP::Config.stub(providers: %w{ldapmain}) } + + it "uses the first provider" do + # Fetch the provider_name attribute from 'options' so that we know + # that the 'options' Hash is not empty/nil. + expect(config.options['provider_name']).to eq('ldapmain') + end + end + end end -end
\ No newline at end of file +end |