parent
5c78ab6838
commit
548b0d8161
2 changed files with 15 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ module Workers
|
|||
object = object_class_string.constantize.find(object_id)
|
||||
receiver = Postzord::Receiver::LocalBatch.new(object, recipient_user_ids)
|
||||
receiver.perform!
|
||||
rescue ActiveRecord::NotFound # Already deleted before the job could run
|
||||
rescue ActiveRecord::RecordNotFound # Already deleted before the job could run
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
14
spec/workers/receive_local_batch_spec.rb
Normal file
14
spec/workers/receive_local_batch_spec.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
require "spec_helper"
|
||||
|
||||
describe Workers::ReceiveLocalBatch do
|
||||
it "calls the postzord" do
|
||||
post = double
|
||||
allow(Post).to receive(:find).with(1).and_return(post)
|
||||
|
||||
zord = double
|
||||
expect(Postzord::Receiver::LocalBatch).to receive(:new).with(post, [2]).and_return(zord)
|
||||
expect(zord).to receive(:perform!)
|
||||
|
||||
Workers::ReceiveLocalBatch.new.perform("Post", 1, [2])
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue