aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authoryhirano55 <yhirano@me.com>2017-08-12 01:08:42 +0900
committerRafael França <rafaelmfranca@gmail.com>2017-08-11 12:08:42 -0400
commitf7da8db7e3ebe23e12d6da44555f054b9e458166 (patch)
treedcb10fd6159e2fc413fba310e1f59d5f11beae9b /railties
parentb4eaf57faccebba6df044c5b3b6e94adf003bddd (diff)
downloadrails-f7da8db7e3ebe23e12d6da44555f054b9e458166.tar.gz
rails-f7da8db7e3ebe23e12d6da44555f054b9e458166.tar.bz2
rails-f7da8db7e3ebe23e12d6da44555f054b9e458166.zip
Refactor app_generator_test (#30192)
Diffstat (limited to 'railties')
-rw-r--r--railties/test/generators/app_generator_test.rb9
1 files changed, 8 insertions, 1 deletions
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