diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-06-07 14:00:32 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-06-07 14:00:32 -0400 |
commit | 1ffa9aa2846b1eed68b3cd01bc47a570e57c03e3 (patch) | |
tree | e8cf3cceafea3f09831c906315856c03201300c6 /railties/test/generators/app_generator_test.rb | |
parent | 26cb88577ae536f88f83e40ff7949ede3d38c465 (diff) | |
parent | b8bb600b58300dee59a88f14d13a7913adef6e73 (diff) | |
download | rails-1ffa9aa2846b1eed68b3cd01bc47a570e57c03e3.tar.gz rails-1ffa9aa2846b1eed68b3cd01bc47a570e57c03e3.tar.bz2 rails-1ffa9aa2846b1eed68b3cd01bc47a570e57c03e3.zip |
Merge pull request #25235 from prathamesh-sonpatki/cleanup
More cleanup of new framework defaults
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index bea8db087f..058308aa13 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -208,24 +208,15 @@ class AppGeneratorTest < Rails::Generators::TestCase FileUtils.rm("#{app_root}/config/initializers/new_framework_defaults.rb") stub_rails_application(app_root) do - generator = Rails::Generators::AppGenerator.new ["rails"], [], destination_root: app_root, shell: @shell + generator = Rails::Generators::AppGenerator.new ["rails"], { update: true }, destination_root: app_root, shell: @shell generator.send(:app_const) quietly { generator.send(:update_config_files) } - assert_no_file "#{app_root}/config/initializers/new_framework_defaults.rb" - end - end - - def test_rails_update_does_not_new_framework_defaults_if_already_present - app_root = File.join(destination_root, 'myapp') - run_generator [app_root] - FileUtils.touch("#{app_root}/config/initializers/new_framework_defaults.rb") - - stub_rails_application(app_root) do - generator = Rails::Generators::AppGenerator.new ["rails"], [], destination_root: app_root, shell: @shell - generator.send(:app_const) - quietly { generator.send(:update_config_files) } - assert_file "#{app_root}/config/initializers/new_framework_defaults.rb" + assert_file "#{app_root}/config/initializers/new_framework_defaults.rb" do |content| + assert_match(/ActiveSupport\.halt_callback_chains_on_return_false = true/, content) + assert_match(/Rails\.application\.config.active_record\.belongs_to_required_by_default = false/, content) + assert_no_match(/Rails\.application\.config\.ssl_options/, content) + end end end |