diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-01-18 01:43:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-18 01:43:16 -0500 |
commit | a4dbbde4c91a52e28b6c4772b0032b9c16d636ca (patch) | |
tree | d0efee32f11662beb7a90e7710f1d5cba819ae52 /actionview/test | |
parent | 0e119480fca1d830bcfcf01ada041d890ba82325 (diff) | |
parent | 8040f527c3f75638829809662a52af04d50369f9 (diff) | |
download | rails-a4dbbde4c91a52e28b6c4772b0032b9c16d636ca.tar.gz rails-a4dbbde4c91a52e28b6c4772b0032b9c16d636ca.tar.bz2 rails-a4dbbde4c91a52e28b6c4772b0032b9c16d636ca.zip |
Merge pull request #27693 from kenta-s/improve-to_sentence-method
Fix unexpected behavior of `to_sentence` with $,
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/output_safety_helper_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionview/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb index e3f515bb1c..0f3288130b 100644 --- a/actionview/test/template/output_safety_helper_test.rb +++ b/actionview/test/template/output_safety_helper_test.rb @@ -92,4 +92,14 @@ class OutputSafetyHelperTest < ActionView::TestCase assert_equal "one, two three", to_sentence(["one", "two", "three"], last_word_connector: " ") assert_equal "one, two and three", to_sentence(["one", "two", "three"], last_word_connector: " and ") end + + test "to_sentence is not affected by $," do + $, = "|" + begin + assert_equal "one and two", to_sentence(["one", "two"]) + assert_equal "one, two, and three", to_sentence(["one", "two", "three"]) + ensure + $, = nil + end + end end |