提交 07c9ff0b 编写于 作者: D Damien Mathieu

add test checking that precompiling assets performs caching

上级 02691d35
......@@ -8,7 +8,7 @@ class AssetsTest < Test::Unit::TestCase
include Rack::Test::Methods
def setup
build_app
build_app(:initializers => true)
boot_rails
end
......@@ -61,6 +61,16 @@ def app
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; }"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册