summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-24 21:19:17 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-24 21:19:17 +0100
commitef8b1dbf21a90f719c2e8b8c052e16f6107193c6 (patch)
tree6138768916e7b65a7955e8e8c4ed1eb1541e8ced /spec/lib
parent32543f3bd94b1b66dd949b0fb1f57bff3732eb45 (diff)
parente3befaed82f9aa52c79a1d4c437fe4fc63f8d07a (diff)
downloadgitlab-ce-ef8b1dbf21a90f719c2e8b8c052e16f6107193c6.tar.gz
Merge branch 'master' into milestone-ref
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/ldap/user_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb
index 3bba5e2efa2..1e755259dae 100644
--- a/spec/lib/gitlab/ldap/user_spec.rb
+++ b/spec/lib/gitlab/ldap/user_spec.rb
@@ -42,6 +42,21 @@ describe Gitlab::LDAP::User, lib: true do
end
end
+ describe '.find_by_uid_and_provider' do
+ it 'retrieves the correct user' do
+ special_info = {
+ name: 'John Åström',
+ email: 'john@example.com',
+ nickname: 'jastrom'
+ }
+ special_hash = OmniAuth::AuthHash.new(uid: 'CN=John Åström,CN=Users,DC=Example,DC=com', provider: 'ldapmain', info: special_info)
+ special_chars_user = described_class.new(special_hash)
+ user = special_chars_user.save
+
+ expect(described_class.find_by_uid_and_provider(special_hash.uid, special_hash.provider)).to eq user
+ end
+ end
+
describe :find_or_create do
it "finds the user if already existing" do
create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain')