aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-07-16 07:07:27 +0200
committerGitHub <noreply@github.com>2017-07-16 07:07:27 +0200
commit1766e8e6ff9133b8254937791d48eedf2a3f7864 (patch)
tree64eaf145db921dfae9ecf6df050810ccefe135c9 /railties/test
parent6f9c55f820877608528e1380881df4b0f0a2dfe7 (diff)
parent5803640261a324bd7d7665a2bad5b5dc6da29255 (diff)
downloadrails-1766e8e6ff9133b8254937791d48eedf2a3f7864.tar.gz
rails-1766e8e6ff9133b8254937791d48eedf2a3f7864.tar.bz2
rails-1766e8e6ff9133b8254937791d48eedf2a3f7864.zip
Merge pull request #29645 from y-yagi/check_component_when_run_app_update
Do not generate unused components contents in `app:update` task
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/app_generator_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 059c2692be..ffdee3a6b5 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -278,6 +278,22 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_app_update_does_not_generate_action_cable_contents_when_skip_action_cable_is_given
+ app_root = File.join(destination_root, "myapp")
+ run_generator [app_root, "--skip-action-cable"]
+
+ FileUtils.cd(app_root) do
+ # For avoid conflict file
+ FileUtils.rm("#{app_root}/config/secrets.yml")
+ quietly { system("bin/rails app:update") }
+ end
+
+ assert_no_file "#{app_root}/config/cable.yml"
+ assert_file "#{app_root}/config/environments/production.rb" do |content|
+ assert_no_match(/config\.action_cable/, content)
+ end
+ end
+
def test_application_names_are_not_singularized
run_generator [File.join(destination_root, "hats")]
assert_file "hats/config/environment.rb", /Rails\.application\.initialize!/