spec/omniauth/strategies/github_spec.rb in omniauth-github-1.2.1 vs spec/omniauth/strategies/github_spec.rb in omniauth-github-1.2.2
- old
+ new
@@ -133,9 +133,17 @@
subject.options['scope'] = 'user'
expect(subject.emails).to eq(parsed_response)
end
end
+ context '#info.email' do
+ it 'should use any available email' do
+ allow(subject).to receive(:raw_info).and_return({})
+ allow(subject).to receive(:email).and_return('you@example.com')
+ expect(subject.info['email']).to eq('you@example.com')
+ end
+ end
+
context '#info.urls' do
it 'should use html_url from raw_info' do
allow(subject).to receive(:raw_info).and_return({ 'login' => 'me', 'html_url' => 'http://enterprise/me' })
expect(subject.info['urls']['GitHub']).to eq('http://enterprise/me')
end