Commit 548b0d81 authored by Jonne Haß's avatar Jonne Haß

Rescue correct constant in Workers::ReceiveLocalBatch

Fixes #5834
parent 5c78ab68
......@@ -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
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment