diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-16 13:31:06 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-16 13:31:20 -0300 |
commit | 3acf28773b5eebb09f720b7e343b9f3a1911d2e0 (patch) | |
tree | 967c722dc573cfed3e627cf9930ee50d74b54ece /actionview/test/template | |
parent | 8c48cd220648dc05c17def63d653fa98c3fab4de (diff) | |
parent | db9a5c5a1f8e2a1590f0ac9436587d58a67a629e (diff) | |
download | rails-3acf28773b5eebb09f720b7e343b9f3a1911d2e0.tar.gz rails-3acf28773b5eebb09f720b7e343b9f3a1911d2e0.tar.bz2 rails-3acf28773b5eebb09f720b7e343b9f3a1911d2e0.zip |
Merge pull request #15021 from hubertlepicki/allow_custom_host_in_asset_url
Allow custom asset host to be passed in asset_url
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/asset_tag_helper_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb index 18e4277d7a..343681b5a9 100644 --- a/actionview/test/template/asset_tag_helper_test.rb +++ b/actionview/test/template/asset_tag_helper_test.rb @@ -596,6 +596,10 @@ class AssetTagHelperNonVhostTest < ActionView::TestCase assert_equal "gopher://www.example.com", compute_asset_host("foo", :protocol => :request) end + def test_should_return_custom_host_if_passed_in_options + assert_equal "http://custom.example.com", compute_asset_host("foo", :host => "http://custom.example.com") + end + def test_should_ignore_relative_root_path_on_complete_url assert_dom_equal(%(http://www.example.com/images/xml.png), image_path("http://www.example.com/images/xml.png")) end @@ -759,4 +763,15 @@ class AssetUrlHelperEmptyModuleTest < ActionView::TestCase assert @module.config.asset_host assert_equal "http://www.example.com/foo", @module.asset_url("foo") end + + def test_asset_url_with_custom_asset_host + @module.instance_eval do + def config + Struct.new(:asset_host).new("http://www.example.com") + end + end + + assert @module.config.asset_host + assert_equal "http://custom.example.com/foo", @module.asset_url("foo", :host => "http://custom.example.com") + end end |