aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/tag_helper_test.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-08-12 04:18:44 -0300
committerGitHub <noreply@github.com>2016-08-12 04:18:44 -0300
commitdd5c0696d87d82ae118d74984dbfd7569cd4e9d8 (patch)
tree84aaacf6ff61b9ed66ca5b181d1444a7b58d2764 /actionview/test/template/tag_helper_test.rb
parent5821baebe5cedf710ffa5bd99ff80b2150227676 (diff)
parent20afe71f5f63ad07b99e7257539fffd0da817e83 (diff)
downloadrails-dd5c0696d87d82ae118d74984dbfd7569cd4e9d8.tar.gz
rails-dd5c0696d87d82ae118d74984dbfd7569cd4e9d8.tar.bz2
rails-dd5c0696d87d82ae118d74984dbfd7569cd4e9d8.zip
Merge pull request #26133 from smellsblue/dont-fail-on-non-string
Ensure values are strings before calling gsub
Diffstat (limited to 'actionview/test/template/tag_helper_test.rb')
-rw-r--r--actionview/test/template/tag_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionview/test/template/tag_helper_test.rb b/actionview/test/template/tag_helper_test.rb
index c7c6649657..d07312ace3 100644
--- a/actionview/test/template/tag_helper_test.rb
+++ b/actionview/test/template/tag_helper_test.rb
@@ -59,6 +59,14 @@ class TagHelperTest < ActionView::TestCase
assert_equal "<p included=\"\"></p>", tag.p(included: "")
end
+ def test_tag_options_accepts_symbol_option_when_not_escaping
+ assert_equal "<p value=\"symbol\" />", tag("p", { value: :symbol }, false, false)
+ end
+
+ def test_tag_options_accepts_integer_option_when_not_escaping
+ assert_equal "<p value=\"42\" />", tag("p", { value: 42 }, false, false)
+ end
+
def test_tag_options_converts_boolean_option
assert_dom_equal '<p disabled="disabled" itemscope="itemscope" multiple="multiple" readonly="readonly" allowfullscreen="allowfullscreen" seamless="seamless" typemustmatch="typemustmatch" sortable="sortable" default="default" inert="inert" truespeed="truespeed" />',
tag("p", disabled: true, itemscope: true, multiple: true, readonly: true, allowfullscreen: true, seamless: true, typemustmatch: true, sortable: true, default: true, inert: true, truespeed: true)