From c9260c556ca5e238225de23bf2fd2cf21400f8aa Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 18 Feb 2007 07:23:57 +0000 Subject: Add request protocol to asset host if not given. Prefer setting asset host as hostname only, no request protocol. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/asset_tag_helper_test.rb | 11 +++++++++++ 1 file changed, 11 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 5393e30724..33705b8e7c 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -189,6 +189,10 @@ class AssetTagHelperNonVhostTest < Test::Unit::TestCase def relative_url_root "/collaboration/hieraki" end + + def protocol + 'gopher://' + end end.new @controller.request = @request @@ -230,4 +234,11 @@ class AssetTagHelperNonVhostTest < Test::Unit::TestCase ensure ActionController::Base.asset_host = nil end + + def test_asset_host_without_protocol_should_use_request_protocol + ActionController::Base.asset_host = 'a.example.com' + assert_equal 'gopher://a.example.com/collaboration/hieraki/images/xml.png', image_path('xml.png') + ensure + ActionController::Base.asset_host = nil + end end -- cgit v1.2.3