Skip to content

Instantly share code, notes, and snippets.

@gravis
Created February 10, 2010 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gravis/300467 to your computer and use it in GitHub Desktop.
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
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