Commit 6e1d618de80c76b1d0d13ed0ae97414c8ed76946

Authored by Rafael Martins
1 parent 79a5e556

Fixed delayed_job for the Test environment

vendor/plugins/delayed_job/lib/delayed/message_sending.rb
... ... @@ -8,6 +8,10 @@ module Delayed
8 8 end
9 9  
10 10 def method_missing(method, *args)
  11 + if (Rails.env == "test" or Rails.env == "cucumber")
  12 + @target.send method, *args
  13 + return
  14 + end
11 15 Job.create({
12 16 :payload_object => PerformableMethod.new(@target, method.to_sym, args),
13 17 :priority => ::Delayed::Worker.default_priority
... ... @@ -33,7 +37,7 @@ module Delayed
33 37  
34 38 module ClassMethods
35 39 def handle_asynchronously(method)
36   - return if (Rails.env == "test" or Rails.env == "cucumber")
  40 + return if (Rails.env == "test" or Rails.env == "cucumber")
37 41 aliased_method, punctuation = method.to_s.sub(/([?!=])$/, ''), $1
38 42 with_method, without_method = "#{aliased_method}_with_delay#{punctuation}", "#{aliased_method}_without_delay#{punctuation}"
39 43 define_method(with_method) do |*args|
... ...