diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-02-18 07:23:57 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-02-18 07:23:57 +0000 |
commit | c9260c556ca5e238225de23bf2fd2cf21400f8aa (patch) | |
tree | b2c02f8ee351b8b4dd12e52ec66cb68f9f58f154 /actionpack/test | |
parent | 90c1207c384a39567777bc58f2de38eb7df236d7 (diff) | |
download | rails-c9260c556ca5e238225de23bf2fd2cf21400f8aa.tar.gz rails-c9260c556ca5e238225de23bf2fd2cf21400f8aa.tar.bz2 rails-c9260c556ca5e238225de23bf2fd2cf21400f8aa.zip |
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
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/asset_tag_helper_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 |