aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorkenta-s <knt01222@gmail.com>2017-01-15 12:45:13 +0900
committerkenta-s <knt01222@gmail.com>2017-01-15 13:04:52 +0900
commit31560955907b764d9951ff9b188cff722473ed26 (patch)
treed917380bc4af143b72a51ddacacc73ed8b80d05b /actionview
parentaaece61a53dc943ac0e4b696c39ba61f46b7c7a3 (diff)
downloadrails-31560955907b764d9951ff9b188cff722473ed26.tar.gz
rails-31560955907b764d9951ff9b188cff722473ed26.tar.bz2
rails-31560955907b764d9951ff9b188cff722473ed26.zip
Add test for safe_join
Diffstat (limited to 'actionview')
-rw-r--r--actionview/test/template/output_safety_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionview/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb
index 8691bb11ee..e3f515bb1c 100644
--- a/actionview/test/template/output_safety_helper_test.rb
+++ b/actionview/test/template/output_safety_helper_test.rb
@@ -33,6 +33,11 @@ class OutputSafetyHelperTest < ActionView::TestCase
assert_equal "&quot;a&quot; &lt;br/&gt; &lt;b&gt; &lt;br/&gt; &lt;c&gt;", joined
end
+ test "safe_join should return the safe string separated by $, when second argument is not passed" do
+ joined = safe_join(["a", "b"])
+ assert_equal "a#{$,}b", joined
+ end
+
test "to_sentence should escape non-html_safe values" do
actual = to_sentence(%w(< > & ' "))
assert actual.html_safe?