From c1547fcf6d3920e81a56ed032c49ab75faf562d8 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 2 Oct 2011 13:57:29 -0200 Subject: Precompile properly refers files referenced with asset_path test --- railties/test/application/assets_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'railties/test') diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 01fe8eeafd..ba59d3faa7 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -244,7 +244,7 @@ module ApplicationTests assert_match(/app.js isn't precompiled/, last_response.body) end - test "precompile appends the md5 hash to files referenced with asset_path and run in the provided RAILS_ENV" do + test "precompile properly refers files referenced with asset_path and and run in the provided RAILS_ENV" do app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>" # digest is default in false, we must enable it for test environment add_to_config "config.assets.digest = true" @@ -252,6 +252,8 @@ module ApplicationTests capture(:stdout) do Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_ENV=test` } end + file = Dir["#{app_path}/public/assets/application.css"].first + assert_match(/\/assets\/rails\.png/, File.read(file)) file = Dir["#{app_path}/public/assets/application-*.css"].first assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file)) end -- cgit v1.2.3