aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-08-11 10:40:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2016-08-11 10:40:42 -0700
commit5efc4ec4d997cb5f491a7dd79dd94779d08cf80d (patch)
treec102edcfc9b5f8f85bac64520234a804643066c3 /actionpack/test
parentd4a1b33a2ab6703124926fbf805d77ef753e1b87 (diff)
parentebc3639139d21eeb8452edb28ce62530cc075198 (diff)
downloadrails-5efc4ec4d997cb5f491a7dd79dd94779d08cf80d.tar.gz
rails-5efc4ec4d997cb5f491a7dd79dd94779d08cf80d.tar.bz2
rails-5efc4ec4d997cb5f491a7dd79dd94779d08cf80d.zip
Merge branch '3-2-22-3' into 3-2-stable
* 3-2-22-3: bumping version ensure tag/content_tag escapes " in attribute vals
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/tag_helper_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb
index e36295569e..9c3d636765 100644
--- a/actionpack/test/template/tag_helper_test.rb
+++ b/actionpack/test/template/tag_helper_test.rb
@@ -101,6 +101,16 @@ class TagHelperTest < ActionView::TestCase
end
end
+ def test_tag_does_not_honor_html_safe_double_quotes_as_attributes
+ assert_dom_equal '<p title="&quot;">content</p>',
+ content_tag('p', "content", title: '"'.html_safe)
+ end
+
+ def test_data_tag_does_not_honor_html_safe_double_quotes_as_attributes
+ assert_dom_equal '<p data-title="&quot;">content</p>',
+ content_tag('p', "content", data: { title: '"'.html_safe })
+ end
+
def test_skip_invalid_escaped_attributes
['&1;', '&#1dfa3;', '& #123;'].each do |escaped|
assert_equal %(<a href="#{escaped.gsub(/&/, '&amp;')}" />), tag('a', :href => escaped)