aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-03-27 19:36:48 -0400
committerGitHub <noreply@github.com>2017-03-27 19:36:48 -0400
commitf76881750d77245a148bca71bcccd9e0720d0c6b (patch)
treeebc6c9069361b29a8d21bf96fb2032da50f7ae72 /railties/test/generators
parent01e9692caa5dcf8df484fd4f4bfe3f75e26708bc (diff)
parente7c4fe581c6eab18df706875eb57df82e27a1e8f (diff)
downloadrails-f76881750d77245a148bca71bcccd9e0720d0c6b.tar.gz
rails-f76881750d77245a148bca71bcccd9e0720d0c6b.tar.bz2
rails-f76881750d77245a148bca71bcccd9e0720d0c6b.zip
Merge pull request #28557 from y-yagi/remove_unnecessary_files_to_api_applications_when_app_task_task_executed
Remove unnecessary files to API-only Applications when `app:task` task executed
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/api_app_generator_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb
index bb8b29501a..2edb39c8e8 100644
--- a/railties/test/generators/api_app_generator_test.rb
+++ b/railties/test/generators/api_app_generator_test.rb
@@ -61,6 +61,28 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_app_update_does_not_generate_unnecessary_config_files
+ run_generator
+
+ generator = Rails::Generators::AppGenerator.new ["rails"],
+ { api: true, update: true }, destination_root: destination_root, shell: @shell
+ quietly { generator.send(:update_config_files) }
+
+ assert_no_file "config/initializers/cookies_serializer.rb"
+ assert_no_file "config/initializers/assets.rb"
+ assert_no_file "config/initializers/new_framework_defaults_5_1.rb"
+ end
+
+ def test_app_update_does_not_generate_unnecessary_bin_files
+ run_generator
+
+ generator = Rails::Generators::AppGenerator.new ["rails"],
+ { api: true, update: true }, destination_root: destination_root, shell: @shell
+ quietly { generator.send(:update_bin_files) }
+
+ assert_no_file "bin/yarn"
+ end
+
private
def default_files