diff options
author | Jan-Willem van der Meer <mail@jewilmeer.nl> | 2014-09-01 14:26:10 +0200 |
---|---|---|
committer | Jan-Willem van der Meer <mail@jewilmeer.nl> | 2014-09-01 14:26:10 +0200 |
commit | 262276c5f55802541f4df19a44488b4f5239054c (patch) | |
tree | 44fbf002f1c4172317d8836560c1f3f7daff253e /spec | |
parent | 5801d520a75ce03339944d67cfde6cc3c1b05cfc (diff) | |
download | gitlab-ce-262276c5f55802541f4df19a44488b4f5239054c.tar.gz |
Ensure oath callbacks without a nickname work (google)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/oauth/user_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/oauth/user_spec.rb b/spec/lib/gitlab/oauth/user_spec.rb index d6ac0c0896b..7dcc849454b 100644 --- a/spec/lib/gitlab/oauth/user_spec.rb +++ b/spec/lib/gitlab/oauth/user_spec.rb @@ -68,5 +68,17 @@ describe Gitlab::OAuth::User do user = gl_auth.create(auth) expect(user.email).to_not be_empty end + + it 'generates a username if non provided (google)' do + info = double( + uid: 'my-uid', + name: 'John', + email: 'john@example.com' + ) + auth = double(info: info, provider: 'my-provider') + + user = gl_auth.create(auth) + expect(user.username).to eql 'john' + end end end |