rails/activejob/test/cases/test_case_test.rb

24 lines
691 B
Ruby
Raw Normal View History

require "helper"
require "jobs/hello_job"
require "jobs/logging_job"
require "jobs/nested_job"
2014-08-29 20:11:17 +00:00
class ActiveJobTestCaseTest < ActiveJob::TestCase
# this tests that this job class doesn't get its adapter set.
2015-05-25 13:26:15 +00:00
# that's the correct behavior since we don't want to break
# the `class_attribute` inheritance
class TestClassAttributeInheritanceJob < ActiveJob::Base
def self.queue_adapter=(*)
raise "Attempting to break `class_attribute` inheritance, bad!"
end
end
2014-08-29 20:11:17 +00:00
def test_include_helper
assert_includes self.class.ancestors, ActiveJob::TestHelper
end
def test_set_test_adapter
assert_kind_of ActiveJob::QueueAdapters::TestAdapter, queue_adapter
2014-08-29 20:11:17 +00:00
end
end