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

Add verified key to the info Hash

This commit is contained in:
Ryan Sobol 2012-03-09 10:34:40 -08:00
parent 3de9ac0e8d
commit 2990f0660c
2 changed files with 16 additions and 1 deletions

View file

@ -41,7 +41,8 @@ module OmniAuth
'Facebook' => raw_info['link'],
'Website' => raw_info['website']
},
'location' => (raw_info['location'] || {})['name']
'location' => (raw_info['location'] || {})['name'],
'verified' => raw_info['verified']
})
end

View file

@ -145,6 +145,10 @@ describe OmniAuth::Strategies::Facebook do
it 'has no urls' do
subject.info.should_not have_key('urls')
end
it 'has no verified key' do
subject.info.should_not have_key('verified')
end
end
context 'when data is present in raw info' do
@ -206,6 +210,16 @@ describe OmniAuth::Strategies::Facebook do
subject.info['urls']['Facebook'].should eq('http://www.facebook.com/fredsmith')
subject.info['urls']['Website'].should eq('https://my-wonderful-site.com')
end
it 'returns the positive verified status' do
@raw_info['verified'] = true
subject.info['verified'].should be_true
end
it 'returns the negative verified status' do
@raw_info['verified'] = false
subject.info['verified'].should be_false
end
end
end