Skip to content
This repository
Browse code

Merge pull request #5525 from kennyj/fix_5411

Fix GH #5411. When precompiling, params method is undefined.
  • Loading branch information...
commit b714140f4df50d102e70b0151bbb3a09e470d61a 2 parents 89f8866 + 8c262f7
José Valim authored March 22, 2012
2  actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -81,7 +81,7 @@ def stylesheet_path(source)
81 81
     private
82 82
       def debug_assets?
83 83
         compile_assets? && (Rails.application.config.assets.debug || params[:debug_assets])
84  
-      rescue NoMethodError
  84
+      rescue NameError
85 85
         false
86 86
       end
87 87
 
12  railties/test/application/assets_test.rb
@@ -492,6 +492,18 @@ class ::PostsController < ActionController::Base; end
492 492
       assert_match 'src="/sub/uri/assets/rails.png"', File.read("#{app_path}/public/assets/app.js")
493 493
     end
494 494
 
  495
+    test "html assets are compiled when executing precompile" do
  496
+      app_file "app/assets/pages/page.html.erb", "<%= javascript_include_tag :application %>"
  497
+      ENV["RAILS_ENV"]   = "production"
  498
+      ENV["RAILS_GROUP"] = "assets"
  499
+
  500
+      quietly do
  501
+        Dir.chdir(app_path){ `bundle exec rake assets:precompile` }
  502
+      end
  503
+
  504
+      assert File.exists?("#{app_path}/public/assets/page.html")
  505
+    end
  506
+
495 507
     private
496 508
 
497 509
     def app_with_assets_in_view

0 notes on commit b714140

Please sign in to comment.
Something went wrong with that request. Please try again.