1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #39661 from hahmed/railties/faster-app-generator-test-for-load-defaults

Make the test AppGeneratorTest#test_new_application_load_defaults faster
This commit is contained in:
Rafael França 2020-09-24 12:10:28 -04:00 committed by GitHub
commit e3bc380f0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View file

@ -2675,6 +2675,12 @@ module ApplicationTests
assert_equal true, Rails.application.config.rake_eager_load
end
test "unknown_asset_fallback is false by default" do
app "development"
assert_equal false, Rails.application.config.assets.unknown_asset_fallback
end
private
def set_custom_config(contents, config_source = "custom".inspect)
app_file "config/custom.yml", contents

View file

@ -208,16 +208,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
def test_new_application_load_defaults
app_root = File.join(destination_root, "myfirstapp")
run_generator [app_root]
output = nil
assert_file "#{app_root}/config/application.rb", /\s+config\.load_defaults #{Rails::VERSION::STRING.to_f}/
Dir.chdir(app_root) do
output = `SKIP_REQUIRE_WEBPACKER=true ./bin/rails r "puts Rails.application.config.assets.unknown_asset_fallback"`
end
assert_equal "false\n", output
end
def test_csp_initializer_include_connect_src_example