Skip to content

Commit

Permalink
Merge pull request #27 from spraints/html_url
Browse files Browse the repository at this point in the history
Set info.urls['GitHub'] from the user info
  • Loading branch information
mbleigh committed Feb 13, 2015
2 parents 48d718c + dcc846a commit e0304e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/omniauth/strategies/github.rb
Expand Up @@ -32,7 +32,7 @@ def authorize_params
'name' => raw_info['name'],
'image' => raw_info['avatar_url'],
'urls' => {
'GitHub' => "https://github.com/#{raw_info['login']}",
'GitHub' => raw_info['html_url'],
'Blog' => raw_info['blog'],
},
}
Expand Down
7 changes: 7 additions & 0 deletions spec/omniauth/strategies/github_spec.rb
Expand Up @@ -132,4 +132,11 @@
end
end

context '#info.urls' do
it 'should use html_url from raw_info' do
subject.stub(:raw_info).and_return({ 'login' => 'me', 'html_url' => 'http://enterprise/me' })
subject.info['urls']['GitHub'].should == 'http://enterprise/me'
end
end

end

0 comments on commit e0304e7

Please sign in to comment.