diff options
author | Roberto Miranda <rjmaltamar@gmail.com> | 2017-06-03 11:30:01 -0500 |
---|---|---|
committer | Roberto Miranda <rjmaltamar@gmail.com> | 2017-06-29 08:59:54 -0500 |
commit | 43efae22a7a59d5fe0be599bd074c5e7d881266a (patch) | |
tree | 46b09bb4ad1d9452f85dfe8968cb52c0910aa7c2 /actionview/test/template | |
parent | 4448873c8755524ccadd639d1a08df53496c36d7 (diff) | |
download | rails-43efae22a7a59d5fe0be599bd074c5e7d881266a.tar.gz rails-43efae22a7a59d5fe0be599bd074c5e7d881266a.tar.bz2 rails-43efae22a7a59d5fe0be599bd074c5e7d881266a.zip |
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 = { |