diff options
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/delete_post_from_service_spec.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/spec/workers/delete_post_from_service_spec.rb b/spec/workers/delete_post_from_service_spec.rb index 75e902034..2830ca7cd 100644 --- a/spec/workers/delete_post_from_service_spec.rb +++ b/spec/workers/delete_post_from_service_spec.rb @@ -1,16 +1,13 @@ -require 'spec_helper' +require "spec_helper" describe Workers::DeletePostFromService do - before do - @user = alice - @post = @user.post(:status_message, :text => "hello", :to =>@user.aspects.first.id, :public =>true, :facebook_id => "23456" ) - end + it "calls service#delete_from_service with given opts" do + service = double + opts = {facebook_id: "23456"} + + expect(service).to receive(:delete_from_service).with(opts) + allow(Service).to receive(:find_by_id).with("123").and_return(service) - it 'calls service#delete_post with given service' do - m = double() - url = "foobar" - expect(m).to receive(:delete_post) - allow(Service).to receive(:find_by_id).and_return(m) - Workers::DeletePostFromService.new.perform("123", @post.id.to_s) + Workers::DeletePostFromService.new.perform("123", opts) end end |