From 548b0d8161473f12d66663b2657810410a4d3405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Wed, 1 Apr 2015 04:00:49 +0200 Subject: [PATCH 1/2] Rescue correct constant in Workers::ReceiveLocalBatch Fixes #5834 --- app/workers/receive_local_batch.rb | 2 +- spec/workers/receive_local_batch_spec.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 spec/workers/receive_local_batch_spec.rb diff --git a/app/workers/receive_local_batch.rb b/app/workers/receive_local_batch.rb index adcf312aa..e243edf5c 100644 --- a/app/workers/receive_local_batch.rb +++ b/app/workers/receive_local_batch.rb @@ -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 diff --git a/spec/workers/receive_local_batch_spec.rb b/spec/workers/receive_local_batch_spec.rb new file mode 100644 index 000000000..acd841cf3 --- /dev/null +++ b/spec/workers/receive_local_batch_spec.rb @@ -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 From 51c54caa345da009486e775d58dc558e4b3d2573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Wed, 1 Apr 2015 04:02:25 +0200 Subject: [PATCH 2/2] Remove double entries from Gemfile.lock --- Gemfile.lock | 3 --- 1 file changed, 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3562cd873..a777c6155 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,11 +151,8 @@ GEM devise-token_authenticatable (0.3.0) devise (~> 3.4.0) devise_lastseenable (0.0.4) - devise devise rails (>= 3.0.4) - rails (>= 3.0.4) - warden warden diaspora-vines (0.1.27) activerecord (~> 4.1)