diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 7 | ||||
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index a32fb1c57e..c50b0300d5 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -71,9 +71,10 @@ module Sprockets private def debug_assets? - params[:debug_assets] == '1' || - params[:debug_assets] == 'true' || - Rails.application.config.assets.debug + Rails.application.config.assets.allow_debugging && + (Rails.application.config.assets.debug || + params[:debug_assets] == '1' || + params[:debug_assets] == 'true') end # Override to specify an alternative prefix for asset path generation. diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index b5a0e6cf04..6c1f97a44a 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -157,6 +157,7 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>}, javascript_include_tag(:application, :debug => true) + @config.assets.allow_debugging = true @config.assets.debug = true assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>}, javascript_include_tag(:application) @@ -197,6 +198,7 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />}, stylesheet_link_tag(:application, :debug => true) + @config.assets.allow_debugging = true @config.assets.debug = true assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />}, stylesheet_link_tag(:application) |