aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2019-01-03 16:36:17 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2019-01-03 16:36:17 -0500
commitc6ef670aee186a2880b7be59c4c6892b5c983e58 (patch)
tree09535a20e25964529df71adfa88cdfc48463625e /railties/test/generators
parentcc3cc6b50ff8b0ac2c566b74243ea9d82924b283 (diff)
parenta7567068465a76c3d5e12dc04d11f2c434d2c017 (diff)
downloadrails-c6ef670aee186a2880b7be59c4c6892b5c983e58.tar.gz
rails-c6ef670aee186a2880b7be59c4c6892b5c983e58.tar.bz2
rails-c6ef670aee186a2880b7be59c4c6892b5c983e58.zip
Merge pull request #34816 from bogdanvlviv/add-skip-action-mailbox-option-to-rails-new-cmd
Add `--skip-action-mailbox` option to `rails new`
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb5
-rw-r--r--railties/test/generators/shared_generator_tests.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 7d3b031416..f287827f81 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -435,6 +435,11 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_no_file "#{app_root}/config/storage.yml"
end
+ def test_generator_skips_action_mailbox_when_skip_action_mailbox_is_given
+ run_generator [destination_root, "--skip-action-mailbox"]
+ assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']action_mailbox\/engine["']/
+ end
+
def test_generator_skips_action_mailbox_when_skip_active_record_is_given
run_generator [destination_root, "--skip-active-record"]
assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']action_mailbox\/engine["']/
diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb
index 7441ab0603..94f69277f5 100644
--- a/railties/test/generators/shared_generator_tests.rb
+++ b/railties/test/generators/shared_generator_tests.rb
@@ -127,6 +127,7 @@ module SharedGeneratorTests
"--skip-active-record",
"--skip-active-storage",
"--skip-action-mailer",
+ "--skip-action-mailbox",
"--skip-action-cable",
"--skip-sprockets"
]
@@ -138,6 +139,9 @@ module SharedGeneratorTests
assert_file "#{application_path}/config/application.rb", /^# require\s+["']active_storage\/engine["']/
assert_file "#{application_path}/config/application.rb", /^require\s+["']action_controller\/railtie["']/
assert_file "#{application_path}/config/application.rb", /^# require\s+["']action_mailer\/railtie["']/
+ unless generator_class.name == "Rails::Generators::PluginGenerator"
+ assert_file "#{application_path}/config/application.rb", /^# require\s+["']action_mailbox\/engine["']/
+ end
assert_file "#{application_path}/config/application.rb", /^require\s+["']action_view\/railtie["']/
assert_file "#{application_path}/config/application.rb", /^# require\s+["']action_cable\/engine["']/
assert_file "#{application_path}/config/application.rb", /^# require\s+["']sprockets\/railtie["']/