method

before_setup

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: TestHelper
before_setup() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activejob/lib/active_job/test_helper.rb, line 11
    def before_setup # :nodoc:
      test_adapter = queue_adapter_for_test

      @old_queue_adapters = (ActiveJob::Base.subclasses << ActiveJob::Base).select do |klass|
        # only override explicitly set adapters, a quirk of `class_attribute`
        klass.singleton_class.public_instance_methods(false).include?(:_queue_adapter)
      end.map do |klass|
        [klass, klass.queue_adapter].tap do
          klass.queue_adapter = test_adapter
        end
      end

      clear_enqueued_jobs
      clear_performed_jobs
      super
    end
Register or log in to add new notes.