You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/spec/decorators/omni_auth_credentials_spec.rb

41 lines
745 B
Ruby

require 'rails_helper'
describe OmniAuthCredentials do
let(:credentials) { described_class.new(omniauth_hash) }
let(:omniauth_hash) { {
'provider' => 'twitter',
'uid' => '1234567',
'info' => { 'email' => 'foo@bar.com' }
} }
describe '#provider' do
subject { credentials.provider }
it { should eq('twitter') }
end
describe '#uid' do
subject { credentials.uid }
it { should eq('1234567') }
end
describe '#email' do
subject { credentials.email }
it { should eq('foo@bar.com') }
context "when no info section in hash" do
let(:omniauth_hash) { {
'provider' => 'twitter',
'uid' => '1234567'
} }
it { should be(nil) }
end
end
end