rails/activejob/test/cases/test_case_test.rb
Tamir Duberstein 1f8558fa27 ActiveJob::Base#queue_adapter is now a class_attribute
This allows different `queue_adapters` to be used in each `ActiveJob`
class heirarchy. Previously, all subclasses used a single global queue
adapter.
2015-03-11 22:45:59 -07:00

24 lines
696 B
Ruby

require 'helper'
require 'jobs/hello_job'
require 'jobs/logging_job'
require 'jobs/nested_job'
class ActiveJobTestCaseTest < ActiveJob::TestCase
# this tests that this job class doesn't get its adapter set.
# that's the correct behaviour since we don't want to break
# the `class_attribute` inheritence
class TestClassAttributeInheritenceJob < ActiveJob::Base
def self.queue_adapter=(*)
raise 'Attemping to break `class_attribute` inheritence, bad!'
end
end
def test_include_helper
assert_includes self.class.ancestors, ActiveJob::TestHelper
end
def test_set_test_adapter
assert_kind_of ActiveJob::QueueAdapters::TestAdapter, self.queue_adapter
end
end