diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-11-19 18:07:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 18:07:34 -0500 |
commit | 0bbe3409b52d6f7c29a29fbcb9e1acf9d3822406 (patch) | |
tree | 4513b9167599f87408ebf3ed5924f468c4a2fc4c /actionview/test | |
parent | 53478c388837085a8de990f04012e99a94501632 (diff) | |
parent | 4fdc6269b669a8bab7ef4af53868356f6c47f9f5 (diff) | |
download | rails-0bbe3409b52d6f7c29a29fbcb9e1acf9d3822406.tar.gz rails-0bbe3409b52d6f7c29a29fbcb9e1acf9d3822406.tar.bz2 rails-0bbe3409b52d6f7c29a29fbcb9e1acf9d3822406.zip |
Merge pull request #34488 from mullican/word_wrap_preserve_left_side_whitespace
Prevent TextHelper#word_wrap from stripping white space on the left side of long lines; Fixes #34487
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/text_helper_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index 2925489f5d..e961a770e6 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -361,6 +361,10 @@ class TextHelperTest < ActionView::TestCase assert_equal("my very very\nvery long\nstring\n\nwith another\nline", word_wrap("my very very very long string\n\nwith another line", line_width: 15)) end + def test_word_wrap_with_leading_spaces + assert_equal(" This is a paragraph\nthat includes some\nindented lines:\n Like this sample\n blockquote", word_wrap(" This is a paragraph that includes some\nindented lines:\n Like this sample\n blockquote", line_width: 25)) + end + def test_word_wrap_does_not_modify_the_options_hash options = { line_width: 15 } passed_options = options.dup |