mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Improve insufficient test for safe_join
This commit is contained in:
parent
6a1c0218df
commit
b14ac2f7da
1 changed files with 13 additions and 2 deletions
|
@ -34,8 +34,19 @@ class OutputSafetyHelperTest < ActionView::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
test "safe_join should return the safe string separated by $, when second argument is not passed" do
|
test "safe_join should return the safe string separated by $, when second argument is not passed" do
|
||||||
|
default_delimeter = $,
|
||||||
|
|
||||||
|
begin
|
||||||
|
$, = nil
|
||||||
joined = safe_join(["a", "b"])
|
joined = safe_join(["a", "b"])
|
||||||
assert_equal "a#{$,}b", joined
|
assert_equal "ab", joined
|
||||||
|
|
||||||
|
$, = "|"
|
||||||
|
joined = safe_join(["a", "b"])
|
||||||
|
assert_equal "a|b", joined
|
||||||
|
ensure
|
||||||
|
$, = default_delimeter
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "to_sentence should escape non-html_safe values" do
|
test "to_sentence should escape non-html_safe values" do
|
||||||
|
|
Loading…
Reference in a new issue