From f7da8db7e3ebe23e12d6da44555f054b9e458166 Mon Sep 17 00:00:00 2001 From: yhirano55 Date: Sat, 12 Aug 2017 01:08:42 +0900 Subject: Refactor app_generator_test (#30192) --- railties/test/generators/app_generator_test.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 0070527c7b..ff73014046 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -395,12 +395,13 @@ class AppGeneratorTest < Rails::Generators::TestCase end def test_default_frameworks_are_required_when_others_are_removed - run_generator [destination_root, "--skip-active-record", "--skip-action-mailer", "--skip-action-cable", "--skip-sprockets"] + run_generator [destination_root, "--skip-active-record", "--skip-action-mailer", "--skip-action-cable", "--skip-sprockets", "--skip-test"] assert_file "config/application.rb", /require\s+["']rails["']/ assert_file "config/application.rb", /require\s+["']active_model\/railtie["']/ assert_file "config/application.rb", /require\s+["']active_job\/railtie["']/ assert_file "config/application.rb", /require\s+["']action_controller\/railtie["']/ assert_file "config/application.rb", /require\s+["']action_view\/railtie["']/ + assert_file "config/application.rb", /require\s+["']active_storage\/engine["']/ end def test_generator_defaults_to_puma_version @@ -486,6 +487,7 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "config/application.rb", /#\s+require\s+["']action_cable\/engine["']/ assert_no_file "config/cable.yml" assert_no_file "app/assets/javascripts/cable.js" + assert_no_directory "app/assets/javascripts/channels" assert_no_directory "app/channels" assert_file "Gemfile" do |content| assert_no_match(/redis/, content) @@ -592,6 +594,11 @@ class AppGeneratorTest < Rails::Generators::TestCase run_generator([destination_root]) assert_file "package.json", /dependencies/ assert_file "config/initializers/assets.rb", /node_modules/ + + assert_file ".gitignore" do |content| + assert_match(/node_modules/, content) + assert_match(/yarn-error\.log/, content) + end end def test_generator_for_yarn_skipped -- cgit v1.2.3