Add failing test
This commit is contained in:
parent
6c9f191696
commit
f775d74cfd
1 changed files with 10 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ describe ServicesController, :type => :controller do
|
|||
let(:omniauth_auth) do
|
||||
{ 'provider' => 'facebook',
|
||||
'uid' => '2',
|
||||
'info' => { 'nickname' => 'grimmin' },
|
||||
'info' => { 'nickname' => 'grimmin', 'image' => 'http://graph.facebook.com/2/picture' },
|
||||
'credentials' => { 'token' => 'tokin', 'secret' =>"not_so_much" }}
|
||||
end
|
||||
let(:user) { alice }
|
||||
|
|
@ -46,6 +46,15 @@ describe ServicesController, :type => :controller do
|
|||
expect(user.reload.services.first.class.name).to eq("Services::Facebook")
|
||||
end
|
||||
|
||||
context "when the user hasn't got a profile photo on Diaspora" do
|
||||
before { user.person.profile.update_attribute :image_url, nil }
|
||||
|
||||
it "imports the profile photo from the service" do
|
||||
expect(Workers::FetchProfilePhoto).to receive(:perform_async)
|
||||
post :create, :provider => 'facebook'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when service exists with the same uid' do
|
||||
before { Services::Twitter.create!(uid: omniauth_auth['uid'], user_id: user.id) }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue