aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/tag_helper_test.rb
diff options
context:
space:
mode:
authorSourav Moitra <sourav.moitr@gmail.com>2016-02-13 03:36:59 +0530
committerSourav Moitra <sourav.moitr@gmail.com>2016-02-14 16:45:50 +0530
commitaeee438bf120f44a4402250fa50ef530f3c830a8 (patch)
tree97c06fa7f488acf60959b6e6321526f25db5af55 /actionview/test/template/tag_helper_test.rb
parent73fb2977cab8cd9b8ed7bb61df3072e2ca74b3ce (diff)
downloadrails-aeee438bf120f44a4402250fa50ef530f3c830a8.tar.gz
rails-aeee438bf120f44a4402250fa50ef530f3c830a8.tar.bz2
rails-aeee438bf120f44a4402250fa50ef530f3c830a8.zip
Test to check if the data-attr if nil is same or not
if data attribute is nil it is ignored if value is nil the pair is ignored if value is nil it is skipped Improved test for data attr nil
Diffstat (limited to 'actionview/test/template/tag_helper_test.rb')
-rw-r--r--actionview/test/template/tag_helper_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionview/test/template/tag_helper_test.rb b/actionview/test/template/tag_helper_test.rb
index 6f7a78ccef..f3956a31f6 100644
--- a/actionview/test/template/tag_helper_test.rb
+++ b/actionview/test/template/tag_helper_test.rb
@@ -173,4 +173,10 @@ class TagHelperTest < ActionView::TestCase
tag('a', { aria => { a_float: 3.14, a_big_decimal: BigDecimal.new("-123.456"), a_number: 1, string: 'hello', symbol: :foo, array: [1, 2, 3], hash: { key: 'value'}, string_with_quotes: 'double"quote"party"' } })
}
end
+
+ def test_link_to_data_nil_equal
+ div_type1 = content_tag(:div, 'test', { 'data-tooltip' => nil })
+ div_type2 = content_tag(:div, 'test', { data: {tooltip: nil} })
+ assert_dom_equal div_type1, div_type2
+ end
end