aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/asset_tag_helper_test.rb
diff options
context:
space:
mode:
authorNishant Modak <modak.nishant@gmail.com>2015-11-20 18:17:23 +0530
committerNishant Modak <modak.nishant@gmail.com>2015-11-20 23:16:53 +0530
commit5d45eed2ab9b029da5f6daac4a2834dec2c6bd3d (patch)
tree27f8ba6b7e8456d4cbf8a64f01363af7b73d4a59 /actionview/test/template/asset_tag_helper_test.rb
parentf6d12b8ea235e5b9c1d23edbff88765d7882ce94 (diff)
downloadrails-5d45eed2ab9b029da5f6daac4a2834dec2c6bd3d.tar.gz
rails-5d45eed2ab9b029da5f6daac4a2834dec2c6bd3d.tar.bz2
rails-5d45eed2ab9b029da5f6daac4a2834dec2c6bd3d.zip
Example of setting data attributes for image_tag
Diffstat (limited to 'actionview/test/template/asset_tag_helper_test.rb')
-rw-r--r--actionview/test/template/asset_tag_helper_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb
index a63ac442cd..fe40010528 100644
--- a/actionview/test/template/asset_tag_helper_test.rb
+++ b/actionview/test/template/asset_tag_helper_test.rb
@@ -193,7 +193,8 @@ class AssetTagHelperTest < ActionView::TestCase
%(image_tag("//www.rubyonrails.com/images/rails.png")) => %(<img alt="Rails" src="//www.rubyonrails.com/images/rails.png" />),
%(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("")) => %(<img src="" />),
+ %(image_tag("gold.png", data: { title: 'Rails Application' })) => %(<img data-title="Rails Application" src="/images/gold.png" alt="Gold" />)
}
FaviconLinkToTag = {