diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2014-07-15 09:32:01 +0100 |
---|---|---|
committer | Andrew White <pixeltrix@users.noreply.github.com> | 2014-07-15 09:32:01 +0100 |
commit | c3f4d6c8feafab9ded8b549d745c4731ee17b5c4 (patch) | |
tree | ddfcde5e00a7982cf3c8935868a811509e9cb8d2 /actionview/test | |
parent | 942b3a243403ae20b531ca5a77fcceda9fe6524d (diff) | |
parent | d005777469b7182b1a8f657a5b94363b321bef5d (diff) | |
download | rails-c3f4d6c8feafab9ded8b549d745c4731ee17b5c4.tar.gz rails-c3f4d6c8feafab9ded8b549d745c4731ee17b5c4.tar.bz2 rails-c3f4d6c8feafab9ded8b549d745c4731ee17b5c4.zip |
Merge pull request #16161 from jpawlyn/master
Fix empty host for an asset url when asset_host proc returns nil
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/asset_tag_helper_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb index 343681b5a9..d789a5ca27 100644 --- a/actionview/test/template/asset_tag_helper_test.rb +++ b/actionview/test/template/asset_tag_helper_test.rb @@ -546,6 +546,14 @@ class AssetTagHelperTest < ActionView::TestCase assert_equal "http://cdn.example.com/images/file.png", image_path("file.png") end + def test_image_url_with_asset_host_proc_returning_nil + @controller.config.asset_host = Proc.new { nil } + @controller.request = Struct.new(:base_url, :script_name).new("http://www.example.com", nil) + + assert_equal "/images/rails.png", image_path("rails.png") + assert_equal "http://www.example.com/images/rails.png", image_url("rails.png") + end + def test_caching_image_path_with_caching_and_proc_asset_host_using_request @controller.config.asset_host = Proc.new do |source, request| if request.ssl? |