diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2016-05-29 17:35:51 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2016-05-29 17:35:51 +0200 |
commit | ba8d7fc20d331ff73a59dae0d06736c3538f48b3 (patch) | |
tree | 03b259dabf5ffb175962eed807af5066d92506a7 /railties/test | |
parent | 9c7f18091d5be02abfa23aff8508d70d5d3b0831 (diff) | |
parent | d58cd128dd2dbf7db80cee1e684533b74dfdd97c (diff) | |
download | rails-ba8d7fc20d331ff73a59dae0d06736c3538f48b3.tar.gz rails-ba8d7fc20d331ff73a59dae0d06736c3538f48b3.tar.bz2 rails-ba8d7fc20d331ff73a59dae0d06736c3538f48b3.zip |
Merge pull request #25184 from prathamesh-sonpatki/move-up-framework-initializers
Move new default initializers into separate directory
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/api_app_generator_test.rb | 4 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 34 | ||||
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb index 46efa3856c..505c1be9fc 100644 --- a/railties/test/generators/api_app_generator_test.rb +++ b/railties/test/generators/api_app_generator_test.rb @@ -100,8 +100,8 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase config/initializers/assets.rb config/initializers/cookies_serializer.rb config/initializers/session_store.rb - config/initializers/request_forgery_protection.rb - config/initializers/per_form_csrf_tokens.rb + config/initializers/new_framework_defaults/request_forgery_protection.rb + config/initializers/new_framework_defaults/per_form_csrf_tokens.rb lib/assets vendor/assets test/helpers diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 25a8635e7d..cb656cc94c 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -176,13 +176,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.rm("#{app_root}/config/initializers/callback_terminator.rb") + FileUtils.rm("#{app_root}/config/initializers/new_framework_defaults/callback_terminator.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_no_file "#{app_root}/config/initializers/callback_terminator.rb" + assert_no_file "#{app_root}/config/initializers/new_framework_defaults/callback_terminator.rb" end end @@ -190,13 +190,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.touch("#{app_root}/config/initializers/callback_terminator.rb") + FileUtils.touch("#{app_root}/config/initializers/new_framework_defaults/callback_terminator.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/callback_terminator.rb" + assert_file "#{app_root}/config/initializers/new_framework_defaults/callback_terminator.rb" end end @@ -233,13 +233,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.rm("#{app_root}/config/initializers/active_record_belongs_to_required_by_default.rb") + FileUtils.rm("#{app_root}/config/initializers/new_framework_defaults/active_record_belongs_to_required_by_default.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_no_file "#{app_root}/config/initializers/active_record_belongs_to_required_by_default.rb" + assert_no_file "#{app_root}/config/initializers/new_framework_defaults/active_record_belongs_to_required_by_default.rb" end end @@ -247,13 +247,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.touch("#{app_root}/config/initializers/active_record_belongs_to_required_by_default.rb") + FileUtils.touch("#{app_root}/config/initializers/new_framework_defaults/active_record_belongs_to_required_by_default.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/active_record_belongs_to_required_by_default.rb" + assert_file "#{app_root}/config/initializers/new_framework_defaults/active_record_belongs_to_required_by_default.rb" end end @@ -261,13 +261,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.rm("#{app_root}/config/initializers/to_time_preserves_timezone.rb") + FileUtils.rm("#{app_root}/config/initializers/new_framework_defaults/to_time_preserves_timezone.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_no_file "#{app_root}/config/initializers/to_time_preserves_timezone.rb" + assert_no_file "#{app_root}/config/initializers/new_framework_defaults/to_time_preserves_timezone.rb" end end @@ -275,13 +275,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.touch("#{app_root}/config/initializers/to_time_preserves_timezone.rb") + FileUtils.touch("#{app_root}/config/initializers/new_framework_defaults/to_time_preserves_timezone.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/to_time_preserves_timezone.rb" + assert_file "#{app_root}/config/initializers/new_framework_defaults/to_time_preserves_timezone.rb" end end @@ -289,13 +289,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.rm("#{app_root}/config/initializers/ssl_options.rb") + FileUtils.rm("#{app_root}/config/initializers/new_framework_defaults/ssl_options.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_no_file "#{app_root}/config/initializers/ssl_options.rb" + assert_no_file "#{app_root}/config/initializers/new_framework_defaults/ssl_options.rb" end end @@ -303,13 +303,13 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, 'myapp') run_generator [app_root] - FileUtils.touch("#{app_root}/config/initializers/ssl_options.rb") + FileUtils.touch("#{app_root}/config/initializers/new_framework_defaults/ssl_options.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/ssl_options.rb" + assert_file "#{app_root}/config/initializers/new_framework_defaults/ssl_options.rb" end end @@ -452,7 +452,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_generator_if_skip_active_record_is_given run_generator [destination_root, "--skip-active-record"] assert_no_file "config/database.yml" - assert_no_file "config/initializers/active_record_belongs_to_required_by_default.rb" + assert_no_file "config/initializers/new_framework_defaults/active_record_belongs_to_required_by_default.rb" assert_no_file "app/models/application_record.rb" assert_file "config/application.rb", /#\s+require\s+["']active_record\/railtie["']/ assert_file "test/test_helper.rb" do |helper_content| diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 52e0277633..9dac1008fa 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -111,7 +111,7 @@ module TestHelpers # Delete the initializers unless requested unless options[:initializers] - Dir["#{app_path}/config/initializers/*.rb"].each do |initializer| + Dir["#{app_path}/config/initializers/**/*.rb"].each do |initializer| File.delete(initializer) end end |