From 9195cdb7cd3e630d7c8d155b85d6434a0745d08b Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Tue, 9 Oct 2018 09:30:45 +0900 Subject: [PATCH] Use `--skip-webpack-install` by default To remove extra `--no-skip-javascript` tests. --- railties/lib/rails/generators/testing/behaviour.rb | 2 +- railties/test/generators/app_generator_test.rb | 4 ++-- railties/test/generators/shared_generator_tests.rb | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/railties/lib/rails/generators/testing/behaviour.rb b/railties/lib/rails/generators/testing/behaviour.rb index 238ffdd677..ec29ad12ba 100644 --- a/railties/lib/rails/generators/testing/behaviour.rb +++ b/railties/lib/rails/generators/testing/behaviour.rb @@ -68,7 +68,7 @@ module Rails capture(:stdout) do args += ["--skip-bundle"] unless args.include? "--dev" args |= ["--skip-bootsnap"] unless args.include? "--no-skip-bootsnap" - args |= ["--skip-javascript"] unless args.include? "--no-skip-javascript" + args |= ["--skip-webpack-install"] unless args.include? "--no-skip-webpack-install" generator_class.start(args, config.reverse_merge(destination_root: destination_root)) end diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 90fa89e687..a1d91a2f98 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -113,7 +113,7 @@ class AppGeneratorTest < Rails::Generators::TestCase end def test_assets - run_generator [destination_root, "--no-skip-javascript", "--skip-webpack-install"] + run_generator assert_file("app/views/layouts/application.html.erb", /stylesheet_link_tag\s+'application', media: 'all', 'data-turbolinks-track': 'reload'/) assert_file("app/views/layouts/application.html.erb", /javascript_pack_tag\s+'application', 'data-turbolinks-track': 'reload'/) @@ -840,7 +840,7 @@ class AppGeneratorTest < Rails::Generators::TestCase end def test_generator_if_skip_turbolinks_is_given - run_generator [destination_root, "--skip-turbolinks", "--no-skip-javascript", "--skip-webpack-install"] + run_generator [destination_root, "--skip-turbolinks"] assert_no_gem "turbolinks" assert_file "app/views/layouts/application.html.erb" do |content| diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb index e2f8500ea4..fc654e867b 100644 --- a/railties/test/generators/shared_generator_tests.rb +++ b/railties/test/generators/shared_generator_tests.rb @@ -27,7 +27,7 @@ module SharedGeneratorTests end def test_skeleton_is_created - run_generator [destination_root, "--no-skip-javascript", "--skip-webpack-install"] + run_generator default_files.each { |path| assert_file path } end @@ -196,7 +196,7 @@ module SharedGeneratorTests end def test_generator_for_active_storage - run_generator [destination_root, "--no-skip-javascript", "--skip-webpack-install"] + run_generator unless generator_class.name == "Rails::Generators::PluginGenerator" assert_file "#{application_path}/app/javascript/packs/application.js" do |content| @@ -226,7 +226,7 @@ module SharedGeneratorTests end def test_generator_if_skip_active_storage_is_given - run_generator [destination_root, "--skip-active-storage", "--no-skip-javascript", "--skip-webpack-install"] + run_generator [destination_root, "--skip-active-storage"] assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']active_storage\/engine["']/ @@ -256,7 +256,7 @@ module SharedGeneratorTests end def test_generator_does_not_generate_active_storage_contents_if_skip_active_record_is_given - run_generator [destination_root, "--skip-active-record", "--no-skip-javascript", "--skip-webpack-install"] + run_generator [destination_root, "--skip-active-record"] assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']active_storage\/engine["']/