From 2c7abe1b5682d287b19dde5900087908c976109c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 26 Oct 2008 16:50:18 +0100 Subject: Fixed bug with asset timestamping when using relative_url_root (Joe Goldwasser) [#1265 status:committed] --- actionpack/test/template/asset_tag_helper_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index 6dc1225035..bade96fe17 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -248,6 +248,14 @@ class AssetTagHelperTest < ActionView::TestCase assert_equal %(Rails), image_tag("rails.png") end + def test_timebased_asset_id_with_relative_url_root + ActionController::Base.relative_url_root = "/collaboration/hieraki" + expected_time = File.stat(File.expand_path(File.dirname(__FILE__) + "/../fixtures/public/images/rails.png")).mtime.to_i.to_s + assert_equal %(Rails), image_tag("rails.png") + ensure + ActionController::Base.relative_url_root = "" + end + def test_should_skip_asset_id_on_complete_url assert_equal %(Rails), image_tag("http://www.example.com/rails.png") end -- cgit v1.2.3