Commit d63bddcedc13667c8a6c92311bb8e5487295c8b2

Authored by Rafael Martins
1 parent 8c4073d6

Fix for delayed_job to disable asynchronous jobs when testing

vendor/plugins/delayed_job/lib/delayed/message_sending.rb
@@ -33,6 +33,7 @@ module Delayed @@ -33,6 +33,7 @@ module Delayed
33 33
34 module ClassMethods 34 module ClassMethods
35 def handle_asynchronously(method) 35 def handle_asynchronously(method)
  36 + return if Rails.env == "test"
36 aliased_method, punctuation = method.to_s.sub(/([?!=])$/, ''), $1 37 aliased_method, punctuation = method.to_s.sub(/([?!=])$/, ''), $1
37 with_method, without_method = "#{aliased_method}_with_delay#{punctuation}", "#{aliased_method}_without_delay#{punctuation}" 38 with_method, without_method = "#{aliased_method}_with_delay#{punctuation}", "#{aliased_method}_without_delay#{punctuation}"
38 define_method(with_method) do |*args| 39 define_method(with_method) do |*args|