Merge pull request #5493 from collimarco/solved5341
This commit is contained in:
commit
9c99ae357a
3 changed files with 14 additions and 4 deletions
|
|
@ -113,6 +113,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a
|
|||
* Improve consistency of poll answer ordering [#5471](https://github.com/diaspora/diaspora/pull/5471)
|
||||
* Fix broken aspect selectbox on asynchronous search results [#5488](https://github.com/diaspora/diaspora/pull/5488)
|
||||
* Replace %{third_party_tools} by the appropriate hyperlink in tags FAQ [#5509](https://github.com/diaspora/diaspora/pull/5509)
|
||||
* Repair downloading the profile image from Facebook [#5493](https://github.com/diaspora/diaspora/pull/5493)
|
||||
|
||||
## Features
|
||||
* Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105)
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ class ServicesController < ApplicationController
|
|||
service = Service.initialize_from_omniauth( omniauth_hash )
|
||||
|
||||
if current_user.services << service
|
||||
no_profile_image_before_update = no_profile_image?
|
||||
current_user.update_profile_with_omniauth(service.info)
|
||||
|
||||
fetch_photo(service) if no_profile_image?
|
||||
fetch_photo(service) if no_profile_image_before_update
|
||||
|
||||
flash[:notice] = I18n.t 'services.create.success'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -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