diff options
Diffstat (limited to 'spec/lib/gitlab/auth/ldap/config_spec.rb')
-rw-r--r-- | spec/lib/gitlab/auth/ldap/config_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/auth/ldap/config_spec.rb b/spec/lib/gitlab/auth/ldap/config_spec.rb index 0967c45d36b..124f072ebe6 100644 --- a/spec/lib/gitlab/auth/ldap/config_spec.rb +++ b/spec/lib/gitlab/auth/ldap/config_spec.rb @@ -502,6 +502,20 @@ AtlErSqafbECNDSwS5BX8yDpu5yRBJ4xegO/rNlmb8ICRYkuJapD1xXicFOsmfUK end end + describe '#default_attributes' do + it 'includes the configured uid attribute in the username attributes' do + stub_ldap_config(options: { 'uid' => 'my_uid_attr' }) + + expect(config.default_attributes['username']).to include('my_uid_attr') + end + + it 'only includes unique values for username attributes' do + stub_ldap_config(options: { 'uid' => 'uid' }) + + expect(config.default_attributes['username']).to contain_exactly('uid', 'sAMAccountName', 'userid') + end + end + describe '#base' do context 'when the configured base is not normalized' do it 'returns the normalized base' do |