Permalink
Browse files

add failing test for #3198

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 7e03ace commit 6b1e4a265ff5138e4581a6e1d42e19051ec6a0b7 @mjtko mjtko committed with josevalim Oct 3, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 railties/test/application/assets_test.rb
View
13 railties/test/application/assets_test.rb
@@ -425,6 +425,19 @@ class ::PostsController < ActionController::Base ; end
assert_equal 1, output.scan("enhancement").size
end
+ test "digested assets are not mistakenly removed" do
+ app_file "public/assets/application.js", "alert();"
+ add_to_config "config.assets.compile = true"
+ add_to_config "config.assets.digest = true"
+
+ quietly do
+ Dir.chdir(app_path){ `bundle exec rake assets:clean assets:precompile` }
+ end
+
+ files = Dir["#{app_path}/public/assets/application-*.js"]
+ assert_equal 1, files.length, "Expected digested application.js asset to be generated, but none found"
+ end
+
private
def app_with_assets_in_view

0 comments on commit 6b1e4a2

Please sign in to comment.