diff options
author | Matthew Draper <matthew@trebex.net> | 2017-07-01 23:58:39 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2017-07-02 00:46:12 +0930 |
commit | 9ecdcac16795854bd02f1addcf75b84d34bbdf86 (patch) | |
tree | 61d039f27a388c525e6444b3661f436bce75f01b /actionview/test/template | |
parent | 6189086c011a6ea6076c10d38da406e8f4065ac2 (diff) | |
parent | 43efae22a7a59d5fe0be599bd074c5e7d881266a (diff) | |
download | rails-9ecdcac16795854bd02f1addcf75b84d34bbdf86.tar.gz rails-9ecdcac16795854bd02f1addcf75b84d34bbdf86.tar.bz2 rails-9ecdcac16795854bd02f1addcf75b84d34bbdf86.zip |
Merge pull request #29349 from robertomiranda/responsive-images
Add srcset option to image_tag helper
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/asset_tag_helper_test.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb index 6093a4e660..d1190b1bd7 100644 --- a/actionview/test/template/asset_tag_helper_test.rb +++ b/actionview/test/template/asset_tag_helper_test.rb @@ -197,7 +197,10 @@ class AssetTagHelperTest < ActionView::TestCase %(image_tag("mouse.png", :alt => nil)) => %(<img src="/images/mouse.png" />), %(image_tag("data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", :alt => nil)) => %(<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />), %(image_tag("")) => %(<img src="" />), - %(image_tag("gold.png", data: { title: 'Rails Application' })) => %(<img data-title="Rails Application" src="/images/gold.png" alt="Gold" />) + %(image_tag("gold.png", data: { title: 'Rails Application' })) => %(<img data-title="Rails Application" src="/images/gold.png" alt="Gold" />), + %(image_tag("rss.gif", srcset: "/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w")) => %(<img srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w" src="/images/rss.gif" alt="Rss" />), + %(image_tag("rss.gif", srcset: { "pic_640.jpg" => "640w", "pic_1024.jpg" => "1024w" })) => %(<img srcset="/images/pic_640.jpg 640w, /images/pic_1024.jpg 1024w" src="/images/rss.gif" alt="Rss" />), + %(image_tag("rss.gif", srcset: [["pic_640.jpg", "640w"], ["pic_1024.jpg", "1024w"]])) => %(<img srcset="/images/pic_640.jpg 640w, /images/pic_1024.jpg 1024w" src="/images/rss.gif" alt="Rss" />) } FaviconLinkToTag = { |