Created
February 10, 2010 15:58
-
-
Save gravis/300467 to your computer and use it in GitHub Desktop.
Don't enqueue Jobs in test, redis will fail fetching non-existing objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV["RAILS_ENV"] = "test" | |
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") | |
require 'test_help' | |
require 'authlogic/test_case' | |
class ActiveSupport::TestCase | |
[...] | |
end | |
module Resque | |
def enqueue(klass, *args) | |
# we don't want resque to enqueue anything in test | |
Rails.logger.info "Resque::enqueue trapped (#{klass.name})" | |
end | |
end | |
module ResqueScheduler | |
def enqueue_at(timestamp, klass, *args) | |
Rails.logger.info "ResqueScheduler::enqueue_at trapped (#{klass.name})" | |
end | |
def enqueue_in(number_of_seconds_from_now, klass, *args) | |
Rails.logger.info "ResqueScheduler::enqueue_in trapped (#{klass.name})" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment