parent
0ec4abf73c
commit
5801d520a7
2 changed files with 13 additions and 0 deletions
|
@ -73,6 +73,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def email
|
||||
return unless auth.info.respond_to?(:email)
|
||||
auth.info.email.downcase unless auth.info.email.nil?
|
||||
end
|
||||
|
||||
|
|
|
@ -56,5 +56,17 @@ describe Gitlab::OAuth::User do
|
|||
user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit
|
||||
user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group
|
||||
end
|
||||
|
||||
it "Set a temp email address if not provided (like twitter does)" do
|
||||
info = double(
|
||||
uid: 'my-uid',
|
||||
nickname: 'john',
|
||||
name: 'John'
|
||||
)
|
||||
auth = double(info: info, provider: 'my-provider')
|
||||
|
||||
user = gl_auth.create(auth)
|
||||
expect(user.email).to_not be_empty
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue