diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/fixtures/sprockets/app/images/logo.png | bin | 0 -> 6646 bytes | |||
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/fixtures/sprockets/app/images/logo.png b/actionpack/test/fixtures/sprockets/app/images/logo.png Binary files differnew file mode 100644 index 0000000000..d5edc04e65 --- /dev/null +++ b/actionpack/test/fixtures/sprockets/app/images/logo.png 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) |