aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/output_safety_helper_test.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-01-18 01:41:26 -0500
committerGitHub <noreply@github.com>2017-01-18 01:41:26 -0500
commit0e119480fca1d830bcfcf01ada041d890ba82325 (patch)
tree65b844e5240167e1341915479823c92e55d9171f /actionview/test/template/output_safety_helper_test.rb
parentb19c2216a9f25512ed60ae6047852cd6506c094a (diff)
parent31560955907b764d9951ff9b188cff722473ed26 (diff)
downloadrails-0e119480fca1d830bcfcf01ada041d890ba82325.tar.gz
rails-0e119480fca1d830bcfcf01ada041d890ba82325.tar.bz2
rails-0e119480fca1d830bcfcf01ada041d890ba82325.zip
Merge pull request #27688 from kenta-s/add-test-for-safe_join
Add test for `safe_join`
Diffstat (limited to 'actionview/test/template/output_safety_helper_test.rb')
-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?