diff options
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/tag_helper_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb index b45be96959..8611f4c9bd 100644 --- a/actionpack/test/template/tag_helper_test.rb +++ b/actionpack/test/template/tag_helper_test.rb @@ -38,4 +38,16 @@ class TagHelperTest < Test::Unit::TestCase def test_cdata_section assert_equal "<![CDATA[<hello world>]]>", cdata_section("<hello world>") end + + def test_double_escaping_attributes + ['1&2', '1 < 2', '“test“'].each do |escaped| + assert_equal %(<a href="#{escaped}" />), tag('a', :href => escaped) + end + end + + def test_skip_invalid_escaped_attributes + ['&1;', 'dfa3;', '& #123;'].each do |escaped| + assert_equal %(<a href="#{escaped.gsub /&/, '&'}" />), tag('a', :href => escaped) + end + end end |