Merge pull request #27688 from kenta-s/add-test-for-safe_join

Add test for `safe_join`
This commit is contained in:
Rafael França 2017-01-18 01:41:26 -05:00 committed by GitHub
commit 0e119480fc
1 changed files with 5 additions and 0 deletions

View File

@ -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?