mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
add application_job.rb to template of mountable engine
since cb01246721
, generated job inherents from ApplicationJob,
ApplicationJob is required in the mountable engine.
This commit is contained in:
parent
094571b46d
commit
c0e5905ccc
2 changed files with 9 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
|||
<%= wrap_in_modules <<-rb.strip_heredoc
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
end
|
||||
rb
|
||||
%>
|
|
@ -304,6 +304,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "lib/bukkits/engine.rb", /isolate_namespace Bukkits/
|
||||
assert_file "test/dummy/config/routes.rb", /mount Bukkits::Engine => "\/bukkits"/
|
||||
assert_file "app/controllers/bukkits/application_controller.rb", /module Bukkits\n class ApplicationController < ActionController::Base/
|
||||
assert_file "app/jobs/bukkits/application_job.rb", /module Bukkits\n class ApplicationJob < ActiveJob::Base/
|
||||
assert_file "app/helpers/bukkits/application_helper.rb", /module Bukkits\n module ApplicationHelper/
|
||||
assert_file "app/views/layouts/bukkits/application.html.erb" do |contents|
|
||||
assert_match "<title>Bukkits</title>", contents
|
||||
|
@ -327,6 +328,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "hyphenated-name/lib/hyphenated/name.rb", /require "hyphenated\/name\/engine"/
|
||||
assert_file "hyphenated-name/test/dummy/config/routes.rb", /mount Hyphenated::Name::Engine => "\/hyphenated-name"/
|
||||
assert_file "hyphenated-name/app/controllers/hyphenated/name/application_controller.rb", /module Hyphenated\n module Name\n class ApplicationController < ActionController::Base\n end\n end\nend/
|
||||
assert_file "hyphenated-name/app/jobs/hyphenated/name/application_job.rb", /module Hyphenated\n module Name\n class ApplicationJob < ActiveJob::Base/
|
||||
assert_file "hyphenated-name/app/helpers/hyphenated/name/application_helper.rb", /module Hyphenated\n module Name\n module ApplicationHelper\n end\n end\nend/
|
||||
assert_file "hyphenated-name/app/views/layouts/hyphenated/name/application.html.erb" do |contents|
|
||||
assert_match "<title>Hyphenated name</title>", contents
|
||||
|
@ -346,6 +348,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "my_hyphenated-name/lib/my_hyphenated/name.rb", /require "my_hyphenated\/name\/engine"/
|
||||
assert_file "my_hyphenated-name/test/dummy/config/routes.rb", /mount MyHyphenated::Name::Engine => "\/my_hyphenated-name"/
|
||||
assert_file "my_hyphenated-name/app/controllers/my_hyphenated/name/application_controller.rb", /module MyHyphenated\n module Name\n class ApplicationController < ActionController::Base\n end\n end\nend/
|
||||
assert_file "my_hyphenated-name/app/jobs/my_hyphenated/name/application_job.rb", /module MyHyphenated\n module Name\n class ApplicationJob < ActiveJob::Base/
|
||||
assert_file "my_hyphenated-name/app/helpers/my_hyphenated/name/application_helper.rb", /module MyHyphenated\n module Name\n module ApplicationHelper\n end\n end\nend/
|
||||
assert_file "my_hyphenated-name/app/views/layouts/my_hyphenated/name/application.html.erb" do |contents|
|
||||
assert_match "<title>My hyphenated name</title>", contents
|
||||
|
@ -365,6 +368,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "deep-hyphenated-name/lib/deep/hyphenated/name.rb", /require "deep\/hyphenated\/name\/engine"/
|
||||
assert_file "deep-hyphenated-name/test/dummy/config/routes.rb", /mount Deep::Hyphenated::Name::Engine => "\/deep-hyphenated-name"/
|
||||
assert_file "deep-hyphenated-name/app/controllers/deep/hyphenated/name/application_controller.rb", /module Deep\n module Hyphenated\n module Name\n class ApplicationController < ActionController::Base\n end\n end\n end\nend/
|
||||
assert_file "deep-hyphenated-name/app/jobs/deep/hyphenated/name/application_job.rb", /module Deep\n module Hyphenated\n module Name\n class ApplicationJob < ActiveJob::Base/
|
||||
assert_file "deep-hyphenated-name/app/helpers/deep/hyphenated/name/application_helper.rb", /module Deep\n module Hyphenated\n module Name\n module ApplicationHelper\n end\n end\n end\nend/
|
||||
assert_file "deep-hyphenated-name/app/views/layouts/deep/hyphenated/name/application.html.erb" do |contents|
|
||||
assert_match "<title>Deep hyphenated name</title>", contents
|
||||
|
|
Loading…
Reference in a new issue