diff options
author | Matthew Draper <matthew@trebex.net> | 2014-09-14 06:51:29 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-09-14 07:04:47 +0930 |
commit | 457c876b15640d79f4398c3facb8652210d7c2e0 (patch) | |
tree | 175196f9d8a4fea481de30b8fe0514e2ccc4535f /actionview/test | |
parent | 75e06a197ffb493c7ce9edc1579c1fc8cb5381d7 (diff) | |
download | rails-457c876b15640d79f4398c3facb8652210d7c2e0.tar.gz rails-457c876b15640d79f4398c3facb8652210d7c2e0.tar.bz2 rails-457c876b15640d79f4398c3facb8652210d7c2e0.zip |
Revert "Merge pull request #15312 from JuanitoFatas/action_view/asset_path"
This reverts commit 21ec7fefea5a1b823cb88733b019b3d52240801d.
Per #16911, there's actually a good reason for a "blank" value to have a
useful `to_s` here. So let's also add some tests to prove that.
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/asset_tag_helper_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb index d789a5ca27..df8547ef85 100644 --- a/actionview/test/template/asset_tag_helper_test.rb +++ b/actionview/test/template/asset_tag_helper_test.rb @@ -535,6 +535,17 @@ class AssetTagHelperTest < ActionView::TestCase assert_equal copy, source end + class PlaceholderImage + def blank?; true; end + def to_s; 'no-image-yet.png'; end + end + def test_image_tag_with_blank_placeholder + assert_equal '<img alt="" src="/images/no-image-yet.png" />', image_tag(PlaceholderImage.new, alt: "") + end + def test_image_path_with_blank_placeholder + assert_equal '/images/no-image-yet.png', image_path(PlaceholderImage.new) + end + def test_image_path_with_asset_host_proc_returning_nil @controller.config.asset_host = Proc.new do |source| unless source.end_with?("tiff") |