From 26382e48a4f51bdff66f70c2fe7329bd0c788c1d Mon Sep 17 00:00:00 2001 From: Sergey Kojin Date: Sun, 20 Feb 2011 13:38:23 +0300 Subject: [PATCH] test for asset_host and protocol relative url --- actionpack/test/template/asset_tag_helper_test.rb | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index a1a6b5f..7869386 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -1099,6 +1099,13 @@ class AssetTagHelperNonVhostTest < ActionView::TestCase @controller.config.asset_host = "http://assets.example.com" assert_dom_equal(%(), stylesheet_link_tag("http://bar.example.com/stylesheets/style.css")) end + + def test_should_ignore_asset_host_on_protocol_relative_url + # According to http://labs.apache.org/webarch/uri/rfc/rfc3986.html#relative-ref, example http://labs.apache.org/webarch/uri/rfc/rfc3986.html#relative-normal + @controller.config.asset_host = "http://assets.example.com" + assert_dom_equal(%(), stylesheet_link_tag("//bar.example.com/stylesheets/style.css")) + end + def test_should_wildcard_asset_host_between_zero_and_four @controller.config.asset_host = 'http://a%d.example.com' -- 1.7.2.3