diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-26 16:50:18 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-26 16:50:18 +0100 |
commit | 2c7abe1b5682d287b19dde5900087908c976109c (patch) | |
tree | 316fd5e248c5f112555db52b27a20345f5099c87 /actionpack/test/template | |
parent | 932dffc559ef188eb31d0223116e9da361833488 (diff) | |
download | rails-2c7abe1b5682d287b19dde5900087908c976109c.tar.gz rails-2c7abe1b5682d287b19dde5900087908c976109c.tar.bz2 rails-2c7abe1b5682d287b19dde5900087908c976109c.zip |
Fixed bug with asset timestamping when using relative_url_root (Joe Goldwasser) [#1265 status:committed]
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/asset_tag_helper_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 %(<img alt="Rails" src="/images/rails.png?#{expected_time}" />), 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 %(<img alt="Rails" src="#{ActionController::Base.relative_url_root}/images/rails.png?#{expected_time}" />), image_tag("rails.png") + ensure + ActionController::Base.relative_url_root = "" + end + def test_should_skip_asset_id_on_complete_url assert_equal %(<img alt="Rails" src="http://www.example.com/rails.png" />), image_tag("http://www.example.com/rails.png") end |