diff options
author | st0012 <stan001212@gmail.com> | 2019-04-24 00:22:33 +0800 |
---|---|---|
committer | st0012 <stan001212@gmail.com> | 2019-04-24 02:08:13 +0800 |
commit | d63f9383a6dabfaffbb464409ed94b8d77f12a4f (patch) | |
tree | e49144e0b2204218ba549cb2ca7c89501d188195 /railties/test/generators | |
parent | 6a4eb3e75eabfe6c00ea60b845b487f70a350222 (diff) | |
download | rails-d63f9383a6dabfaffbb464409ed94b8d77f12a4f.tar.gz rails-d63f9383a6dabfaffbb464409ed94b8d77f12a4f.tar.bz2 rails-d63f9383a6dabfaffbb464409ed94b8d77f12a4f.zip |
Remove action_controller.perform_caching from api app's configs
As suggested in https://github.com/rails/rails/issues/35602#issuecomment-485833483, because we don't provide view caching and doesn't include `ActionController::Caching` for api apps, we should also avoid generating
```ruby
config.action_controller.perform_caching = true
```
for those api apps. So it won't confuse people.
**But because `perform_caching` will be `true` if not set, the behavior of the app would still be the same without these configs.**
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/api_app_generator_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb index 503564beec..d03178da66 100644 --- a/railties/test/generators/api_app_generator_test.rb +++ b/railties/test/generators/api_app_generator_test.rb @@ -50,6 +50,13 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase assert_file "config/application.rb", /config\.api_only = true/ assert_file "app/controllers/application_controller.rb", /ActionController::API/ + + assert_file "config/environments/development.rb" do |content| + assert_no_match(/action_controller\.perform_caching = true/, content) + end + assert_file "config/environments/production.rb" do |content| + assert_no_match(/action_controller\.perform_caching = true/, content) + end end def test_generator_if_skip_action_cable_is_given |