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

remove assets config from new_framework_defaults if --skip-sprockets is true

If `sprockets` is not loaded, `Rails.application.config.assets` is not defined.
This commit is contained in:
yuuji.yaginuma 2016-10-25 07:58:05 +09:00
parent a0d0648efb
commit 5b54a90410
2 changed files with 5 additions and 0 deletions

View file

@ -32,7 +32,9 @@ ActiveSupport.halt_callback_chains_on_return_false = <%= options[:update] ? true
# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
Rails.application.config.ssl_options = { hsts: { subdomains: true } }
<%- end -%>
<%- unless options[:skip_sprockets] -%>
# Unknown asset fallback will return the path passed in when the given
# asset is not present in the asset pipeline.
Rails.application.config.assets.unknown_asset_fallback = <%= options[:update] ? true : false %>
<%- end -%>

View file

@ -412,6 +412,9 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_no_match(/config\.assets\.js_compressor = :uglifier/, content)
assert_no_match(/config\.assets\.css_compressor = :sass/, content)
end
assert_file "config/initializers/new_framework_defaults.rb" do |content|
assert_no_match(/unknown_asset_fallback/, content)
end
end
def test_generator_if_skip_action_cable_is_given