aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-07-25 05:36:00 -0700
committerJosé Valim <jose.valim@gmail.com>2011-07-25 05:36:00 -0700
commit451f63b42e411a57796baccca7d27b5746bff49b (patch)
tree22ebe4235f166e09d173b8cf4a46621e6e4b5975
parenta850cf705892a7f2062dd3740f9161f7be49e338 (diff)
parent07c9ff0b4adc41ebcb1116e4ed8ad89f1445d95f (diff)
downloadrails-451f63b42e411a57796baccca7d27b5746bff49b.tar.gz
rails-451f63b42e411a57796baccca7d27b5746bff49b.tar.bz2
rails-451f63b42e411a57796baccca7d27b5746bff49b.zip
Merge pull request #2247 from dmathieu/test_precompile_caching
Add test checking that precompiling assets performs caching
-rw-r--r--railties/test/application/assets_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index e1eee71a9e..810d51b50c 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -8,7 +8,7 @@ module ApplicationTests
include Rack::Test::Methods
def setup
- build_app
+ build_app(:initializers => true)
boot_rails
end
@@ -61,6 +61,16 @@ module ApplicationTests
end
end
+ test "precompile properly performs caching" do
+ app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
+
+ capture(:stdout) do
+ Dir.chdir(app_path){ `bundle exec rake assets:precompile` }
+ end
+ file = Dir["#{app_path}/public/assets/application-*.css"].first
+ assert_match /\/assets\/rails-([0-z]+)\.png/, File.read(file)
+ end
+
test "assets are cleaned up properly" do
app_file "public/assets/application.js", "alert();"
app_file "public/assets/application.css", "a { color: green; }"