diff options
author | José Valim <jose.valim@gmail.com> | 2012-03-22 01:40:54 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-03-22 01:40:54 -0700 |
commit | b714140f4df50d102e70b0151bbb3a09e470d61a (patch) | |
tree | 5550857af30c1f1ac17fb1aefd87b845f21d02a8 | |
parent | 89f88669bfbdc7987032c2716c87faefb8fe4a8e (diff) | |
parent | 8c262f7591d5ea0f26f8edaf50a96d36a2569812 (diff) | |
download | rails-b714140f4df50d102e70b0151bbb3a09e470d61a.tar.gz rails-b714140f4df50d102e70b0151bbb3a09e470d61a.tar.bz2 rails-b714140f4df50d102e70b0151bbb3a09e470d61a.zip |
Merge pull request #5525 from kennyj/fix_5411
Fix GH #5411. When precompiling, params method is undefined.
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 2 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 976ae5a76d..3402343494 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -81,7 +81,7 @@ module Sprockets private def debug_assets? compile_assets? && (Rails.application.config.assets.debug || params[:debug_assets]) - rescue NoMethodError + rescue NameError false end diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index ad87d8b6ac..c864d70fa2 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -492,6 +492,18 @@ module ApplicationTests assert_match 'src="/sub/uri/assets/rails.png"', File.read("#{app_path}/public/assets/app.js") end + test "html assets are compiled when executing precompile" do + app_file "app/assets/pages/page.html.erb", "<%= javascript_include_tag :application %>" + ENV["RAILS_ENV"] = "production" + ENV["RAILS_GROUP"] = "assets" + + quietly do + Dir.chdir(app_path){ `bundle exec rake assets:precompile` } + end + + assert File.exists?("#{app_path}/public/assets/page.html") + end + private def app_with_assets_in_view |