1
0
Fork 0
mirror of https://github.com/simi/omniauth-facebook.git synced 2022-11-09 12:32:45 -05:00

set uid from raw_info

This commit is contained in:
Mark Dodwell 2011-10-15 19:58:33 -07:00
parent 0106bb4b15
commit 8484d7cca5
2 changed files with 9 additions and 0 deletions

View file

@ -16,6 +16,8 @@ module OmniAuth
:header_format => 'OAuth %s',
:param_name => 'access_token'
}
uid { raw_info['id'] }
def build_access_token
super.tap do |token|

View file

@ -43,4 +43,11 @@ describe OmniAuth::Strategies::Facebook do
subject.access_token_options[:header_format].should eq('OAuth %s')
end
end
describe '#uid' do
it 'returns the id from raw_info' do
subject.stub(:raw_info) { { 'id' => '123' } }
subject.uid.should eq('123')
end
end
end