Skip to content
Browse files

Merge pull request #3221 from mjtko/asset-tests

Failing test for assets:clean task issue
  • Loading branch information...
2 parents 8bf761f + a5eca91 commit 306123b56a0725ca0dcc8e987f8dfa03bc1cf41b @josevalim josevalim committed Oct 4, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 railties/test/application/assets_test.rb
View
15 railties/test/application/assets_test.rb
@@ -426,7 +426,7 @@ class ::PostsController < ActionController::Base ; end
end
test "digested assets are not mistakenly removed" do
- app_file "public/assets/application.js", "alert();"
+ app_file "app/assets/application.js", "alert();"
add_to_config "config.assets.compile = true"
add_to_config "config.assets.digest = true"
@@ -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 306123b

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