From a3a5c7eba39c64413abd0fb4766282c9f071d248 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 19 Apr 2011 18:07:14 +0200 Subject: All assets, including images, audio, and video, now uses the asset pipeline when its on --- actionpack/test/template/sprockets_helper_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 67aee86d02..67774c1893 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -22,6 +22,7 @@ class SprocketsHelperTest < ActionView::TestCase @assets = Sprockets::Environment.new @assets.paths << FIXTURES.join("sprockets/app/javascripts") @assets.paths << FIXTURES.join("sprockets/app/stylesheets") + @assets.paths << FIXTURES.join("sprockets/app/images") config.perform_caching = true end @@ -30,6 +31,24 @@ class SprocketsHelperTest < ActionView::TestCase "http://www.example.com" end + test "asset path" do + assert_equal "/assets/logo-9c0a079bdd7701d7e729bd956823d153.png", + sprockets_asset_path("logo.png") + + assert_equal "/images/logo", + sprockets_asset_path("/images/logo") + assert_equal "/images/logo.gif", + sprockets_asset_path("/images/logo.gif") + + assert_equal "/dir/audio", + sprockets_asset_path("/dir/audio") + + assert_equal "http://www.example.com/video/play", + sprockets_asset_path("http://www.example.com/video/play") + assert_equal "http://www.example.com/video/play.mp4", + sprockets_asset_path("http://www.example.com/video/play.mp4") + end + test "javascript path" do assert_equal "/assets/application-d41d8cd98f00b204e9800998ecf8427e.js", sprockets_javascript_path(:application) -- cgit v1.2.3