aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/output_safety_helper_test.rb
diff options
context:
space:
mode:
authorPaul Grayson <paul@pololu.com>2014-06-10 17:33:34 -0700
committerPaul Grayson <paul@pololu.com>2014-06-12 15:30:40 -0700
commitbcab3f20dac0fe993e5d31bf6acef28ec54e658b (patch)
treef3fd8f027b75814410245c91aa87963be1c9f00a /actionview/test/template/output_safety_helper_test.rb
parent80b4fe2c50feb295af64e1a8c960cfed4fd8ae19 (diff)
downloadrails-bcab3f20dac0fe993e5d31bf6acef28ec54e658b.tar.gz
rails-bcab3f20dac0fe993e5d31bf6acef28ec54e658b.tar.bz2
rails-bcab3f20dac0fe993e5d31bf6acef28ec54e658b.zip
In tag helper, honor html_safe on array parameters; also make safe_join more similar to Array.join by first calling flatten.
Diffstat (limited to 'actionview/test/template/output_safety_helper_test.rb')
-rw-r--r--actionview/test/template/output_safety_helper_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionview/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb
index 76c71c9e6d..a1bf0e1a5f 100644
--- a/actionview/test/template/output_safety_helper_test.rb
+++ b/actionview/test/template/output_safety_helper_test.rb
@@ -25,4 +25,11 @@ class OutputSafetyHelperTest < ActionView::TestCase
assert_equal "<p>foo</p><br /><p>bar</p>", joined
end
-end \ No newline at end of file
+ test "safe_join should work recursively similarly to Array.join" do
+ joined = safe_join(['a',['b','c']], ':')
+ assert_equal 'a:b:c', joined
+
+ joined = safe_join(['"a"',['<b>','<c>']], ' <br/> ')
+ assert_equal '&quot;a&quot; &lt;br/&gt; &lt;b&gt; &lt;br/&gt; &lt;c&gt;', joined
+ end
+end