Merge branch 'Ruxton-develop' into develop
This commit is contained in:
commit
d5fbeff03b
3 changed files with 16 additions and 13 deletions
|
|
@ -14,6 +14,7 @@
|
|||
* Fix missing timeago tooltip in conversations [#4257](https://github.com/diaspora/diaspora/issues/4257)
|
||||
* Fix link to background image [#4289](https://github.com/diaspora/diaspora/pull/4289)
|
||||
* Fix Facebox icons 404s when called from Backbone
|
||||
* Fix deleting a post from Facebook [#4290](https://github.com/diaspora/diaspora/pull/4290)
|
||||
|
||||
## Features
|
||||
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Services::Facebook < Service
|
|||
end
|
||||
|
||||
def delete_post(post)
|
||||
if post.present? && post.facebbook_id.present?
|
||||
if post.present? && post.facebook_id.present?
|
||||
Rails.logger.debug("event=delete_from_service type=facebook sender_id=#{self.user_id}")
|
||||
delete_from_facebook("https://graph.facebook.com/#{post.facebook_id}/", {:access_token => self.access_token})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ describe Services::Facebook do
|
|||
|
||||
before do
|
||||
@user = alice
|
||||
@post = @user.post(:status_message, :text => "hello", :to =>@user.aspects.first.id, :public =>true, :facebook_id => "23456", :photos => [])
|
||||
@post = @user.post(:status_message, :text => "hello", :to =>@user.aspects.first.id, :public =>true, :photos => [])
|
||||
@service = Services::Facebook.new(:access_token => "yeah")
|
||||
@user.services << @service
|
||||
end
|
||||
|
|
@ -79,10 +79,12 @@ describe Services::Facebook do
|
|||
|
||||
describe '#delete_post' do
|
||||
it 'removes a post from facebook' do
|
||||
stub_request(:delete, "https://graph.facebook.com/#{@post.facebook_id}/?access_token=#{@service.access_token}").
|
||||
to_return(:status => 200)
|
||||
@post.facebook_id = "2345"
|
||||
url="https://graph.facebook.com/#{@post.facebook_id}/"
|
||||
stub_request(:delete, "#{url}?access_token=#{@service.access_token}").to_return(:status => 200)
|
||||
@service.should_receive(:delete_from_facebook).with(url, {access_token: @service.access_token})
|
||||
|
||||
@service.delete_post(@post.facebook_id)
|
||||
@service.delete_post(@post)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue