aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-10-29 12:29:14 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-10-29 12:29:14 -0700
commit671af0716de6b8991b15e2d2cb56ed6c555cb343 (patch)
tree223c677daf429fcb5e6ec6cef0833f7a735ec9ca /actionview/test
parentdf2226ea16922fd4e2ea72b8ee372a4cb5621114 (diff)
parent805a6cc56469ae50803e922e09e2b9867daff1dd (diff)
downloadrails-671af0716de6b8991b15e2d2cb56ed6c555cb343.tar.gz
rails-671af0716de6b8991b15e2d2cb56ed6c555cb343.tar.bz2
rails-671af0716de6b8991b15e2d2cb56ed6c555cb343.zip
Merge pull request #12693 from carpodaster/convert-cdata-input-to-string
Convert CDATA input to string before gsub'ing
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/tag_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/test/template/tag_helper_test.rb b/actionview/test/template/tag_helper_test.rb
index 802da5d566..fb016a52de 100644
--- a/actionview/test/template/tag_helper_test.rb
+++ b/actionview/test/template/tag_helper_test.rb
@@ -96,6 +96,10 @@ class TagHelperTest < ActionView::TestCase
assert_equal "<![CDATA[<hello world>]]>", cdata_section("<hello world>")
end
+ def test_cdata_section_with_string_conversion
+ assert_equal "<![CDATA[]]>", cdata_section(nil)
+ end
+
def test_cdata_section_splitted
assert_equal "<![CDATA[hello]]]]><![CDATA[>world]]>", cdata_section("hello]]>world")
assert_equal "<![CDATA[hello]]]]><![CDATA[>world]]]]><![CDATA[>again]]>", cdata_section("hello]]>world]]>again")