aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/tag_helper_test.rb
diff options
context:
space:
mode:
authorStephen Celis <stephen@stephencelis.com>2010-10-17 08:18:25 -0500
committerMichael Koziarski <michael@koziarski.com>2010-10-18 11:18:42 +1300
commit5e79094fc1dbb62e27cf21c0f18b586a26d5de46 (patch)
tree4b10b97a9850fe809305876f3b07f373cdfb6132 /actionpack/test/template/tag_helper_test.rb
parent67df21f8954073ddc7f3409ec618c953f97cb412 (diff)
downloadrails-5e79094fc1dbb62e27cf21c0f18b586a26d5de46.tar.gz
rails-5e79094fc1dbb62e27cf21c0f18b586a26d5de46.tar.bz2
rails-5e79094fc1dbb62e27cf21c0f18b586a26d5de46.zip
HTML5 data attribute helpers [#5825 state:resolved].
Diffstat (limited to 'actionpack/test/template/tag_helper_test.rb')
-rw-r--r--actionpack/test/template/tag_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb
index c742683821..60b466a9ff 100644
--- a/actionpack/test/template/tag_helper_test.rb
+++ b/actionpack/test/template/tag_helper_test.rb
@@ -110,4 +110,11 @@ class TagHelperTest < ActionView::TestCase
def test_disable_escaping
assert_equal '<a href="&amp;" />', tag('a', { :href => '&amp;' }, false, false)
end
+
+ def test_data_attributes
+ ['data', :data].each { |data|
+ assert_dom_equal '<a data-a-number="1" data-array="[1,2,3]" data-hash="{&quot;key&quot;:&quot;value&quot;}" data-string="hello" data-symbol="foo" />',
+ tag('a', { data => { :a_number => 1, :string => 'hello', :symbol => :foo, :array => [1, 2, 3], :hash => { :key => 'value'} } })
+ }
+ end
end