diff options
-rw-r--r-- | actionpack/lib/sprockets/assets.rake | 2 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index 7b86d84a27..ff678426ab 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -7,6 +7,7 @@ namespace :assets do ENV["RAILS_GROUPS"] ||= "assets" ENV["RAILS_ENV"] ||= "production" ruby $0, *ARGV + exit else require "fileutils" Rake::Task["tmp:cache:clear"].invoke @@ -42,6 +43,7 @@ namespace :assets do end ENV["RAILS_ASSETS_NONDIGEST"] = "true" ruby $0, *ARGV + exit end end end diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index d0713620bd..6fd8808aaa 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -419,6 +419,12 @@ module ApplicationTests assert_equal "NoPost;\n", File.read("#{app_path}/public/assets/application.js") end + test "enhancements to assets:precompile should only run once" do + app_file "lib/tasks/enhance.rake", "Rake::Task['assets:precompile'].enhance { puts 'enhancement' }" + output = precompile! + assert_equal 1, output.scan("enhancement").size + end + private def app_with_assets_in_view |