From d63bddcedc13667c8a6c92311bb8e5487295c8b2 Mon Sep 17 00:00:00 2001 From: Rafael Martins Date: Sun, 19 Feb 2012 20:49:01 -0200 Subject: [PATCH] Fix for delayed_job to disable asynchronous jobs when testing --- vendor/plugins/delayed_job/lib/delayed/message_sending.rb | 1 + 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/vendor/plugins/delayed_job/lib/delayed/message_sending.rb b/vendor/plugins/delayed_job/lib/delayed/message_sending.rb index 80474cd..c93c996 100644 --- a/vendor/plugins/delayed_job/lib/delayed/message_sending.rb +++ b/vendor/plugins/delayed_job/lib/delayed/message_sending.rb @@ -33,6 +33,7 @@ module Delayed module ClassMethods def handle_asynchronously(method) + return if Rails.env == "test" aliased_method, punctuation = method.to_s.sub(/([?!=])$/, ''), $1 with_method, without_method = "#{aliased_method}_with_delay#{punctuation}", "#{aliased_method}_without_delay#{punctuation}" define_method(with_method) do |*args| -- libgit2 0.21.2