diff options
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 7d3b031416..839e6feb39 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["']/ @@ -445,6 +450,21 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']action_mailbox\/engine["']/ end + def test_generator_skips_action_text_when_skip_action_text_is_given + run_generator [destination_root, "--skip-action-text"] + assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']action_text\/engine["']/ + end + + def test_generator_skips_action_text_when_skip_active_record_is_given + run_generator [destination_root, "--skip-active-record"] + assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']action_text\/engine["']/ + end + + def test_generator_skips_action_text_when_skip_active_storage_is_given + run_generator [destination_root, "--skip-active-storage"] + assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']action_text\/engine["']/ + end + def test_app_update_does_not_change_config_target_version run_generator @@ -753,6 +773,24 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_bundler_command_called("install") end + def test_generation_use_original_bundle_environment + generator([destination_root], skip_webpack_install: true) + + mock_original_env = -> do + { "BUNDLE_RUBYONRAILS__ORG" => "user:pass" } + end + + ensure_environment_is_set = -> *_args do + assert_equal "user:pass", ENV["BUNDLE_RUBYONRAILS__ORG"] + end + + Bundler.stub :original_env, mock_original_env do + generator.stub :exec_bundle_command, ensure_environment_is_set do + quietly { generator.invoke_all } + end + end + end + def test_dev_option generator([destination_root], dev: true, skip_webpack_install: true) |