Permalink
Browse files

add failing test: "digested assets are removed from configured path"

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent db26221 commit 1f0b78e045f005fee96c11be150549d6092a2177 @mjtko mjtko committed with josevalim Oct 4, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 railties/test/application/assets_test.rb
@@ -438,6 +438,19 @@ class ::PostsController < ActionController::Base ; end
assert_equal 1, files.length, "Expected digested application.js asset to be generated, but none found"
end
+ test "digested assets are removed from configured path" do
+ app_file "public/production_assets/application.js", "alert();"
+ add_to_env_config "production", "config.assets.prefix = 'production_assets'"
+
+ ENV["RAILS_ENV"] = nil
+ quietly do
+ Dir.chdir(app_path){ `bundle exec rake assets:clean` }
+ end
+
+ files = Dir["#{app_path}/public/production_assets/application.js"]
+ assert_equal 0, files.length, "Expected application.js asset to be removed, but still exists"
+ end
+
private
def app_with_assets_in_view

0 comments on commit 1f0b78e

Please sign in to comment.