mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fixed bug with asset timestamping when using relative_url_root (Joe Goldwasser) [#1265 status:committed]
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
*2.2.1 [RC2 or 2.2 final]*
|
||||
|
||||
* Fixed bug with asset timestamping when using relative_url_root #1265 [Joe Goldwasser]
|
||||
|
||||
|
||||
*2.2.0 [RC1] (October 24th, 2008)*
|
||||
|
||||
* Fix incorrect closing CDATA delimiter and that HTML::Node.parse would blow up on unclosed CDATA sections [packagethief]
|
||||
|
||||
@@ -588,8 +588,8 @@ module ActionView
|
||||
source += ".#{extension}" if missing_extension?(source)
|
||||
unless source =~ ProtocolRegexp
|
||||
source = "/#{directory}/#{source}" unless source[0] == ?/
|
||||
source = prepend_relative_url_root(source)
|
||||
source = rewrite_asset_path(source)
|
||||
source = prepend_relative_url_root(source)
|
||||
end
|
||||
source = prepend_asset_host(source)
|
||||
source
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user