mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixed failing tests; Load active_job in railtie; Renamed generator to job
This commit is contained in:
parent
0c232779ec
commit
3ed69cd5f5
5 changed files with 9 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
require 'active_model/railtie'
|
||||
require 'active_job'
|
||||
require 'rails'
|
||||
|
||||
module ActiveJob
|
||||
# = Active Job Railtie
|
||||
|
@ -7,4 +8,4 @@ module ActiveJob
|
|||
ActiveSupport.on_load(:active_job) { self.logger = ::Rails.logger }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'rails/generators/named_base'
|
||||
|
||||
module ActiveJob
|
||||
module Rails
|
||||
module Generators # :nodoc:
|
||||
class JobGenerator < Rails::Generators::NamedBase # :nodoc:
|
||||
desc 'This generator creates an active job file at app/jobs'
|
||||
|
@ -19,4 +19,4 @@ module ActiveJob
|
|||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,6 @@
|
|||
require 'helper'
|
||||
require "active_support/log_subscriber/test_helper"
|
||||
require 'active_support/core_ext/numeric/time'
|
||||
require 'jobs/hello_job'
|
||||
require 'jobs/logging_job'
|
||||
require 'jobs/nested_job'
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
require 'helper'
|
||||
require 'jobs/hello_job'
|
||||
require 'jobs/logging_job'
|
||||
require 'jobs/nested_job'
|
||||
|
||||
class QueueNamingTest < ActiveSupport::TestCase
|
||||
test 'name derived from base' do
|
||||
assert_equal "active_jobs", HelloJob.queue_name
|
||||
end
|
||||
|
||||
|
||||
test 'name appended in job' do
|
||||
begin
|
||||
HelloJob.queue_as :greetings
|
||||
|
|
Loading…
Reference in a new issue