Fix GH #5411. When precompiling, params method is undefined. #5525

Merged
merged 1 commit into from Mar 22, 2012
@@ -81,7 +81,7 @@ def stylesheet_path(source)
private
def debug_assets?
compile_assets? && (Rails.application.config.assets.debug || params[:debug_assets])
- rescue NoMethodError
+ rescue NameError
false
end
@@ -492,6 +492,18 @@ class ::PostsController < ActionController::Base; end
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