diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-12 10:19:12 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-12 10:19:12 -0800 |
commit | e705ac74332f6d53024658d81813f52fd782ff9d (patch) | |
tree | 7a4c2f86cd0a6f3436fa8c31d10e94cabd15234d /railties | |
parent | 487318eec0cee14e0ff9d6c657b860b6595ecb5f (diff) | |
parent | 0e780e990bad30b0af0764b16833f35a1b89d72c (diff) | |
download | rails-e705ac74332f6d53024658d81813f52fd782ff9d.tar.gz rails-e705ac74332f6d53024658d81813f52fd782ff9d.tar.bz2 rails-e705ac74332f6d53024658d81813f52fd782ff9d.zip |
Merge pull request #4427 from kennyj/fix_3980
Fix GH #3980. Support assets:cache:clean task.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/assets_test.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 460c921ec3..01156e1b83 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -314,7 +314,7 @@ module ApplicationTests Dir.chdir(app_path){ `bundle exec rake assets:clean` } end - files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/*"] + files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/assets/*"] assert_equal 0, files.length, "Expected no assets, but found #{files.join(', ')}" end @@ -492,6 +492,18 @@ module ApplicationTests assert_match 'src="/sub/uri/assets/rails.png"', File.read("#{app_path}/public/assets/app.js") end + test "assets:cache:clean should clean cache" do + ENV["RAILS_ENV"] = "production" + precompile! + + quietly do + Dir.chdir(app_path){ `bundle exec rake assets:cache:clean` } + end + + require "#{app_path}/config/environment" + assert_equal 0, Dir.entries(Rails.application.assets.cache.cache_path).size - 2 # reject [".", ".."] + end + private def app_with_assets_in_view |