aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-09-30 15:10:52 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-09-30 15:10:52 -0300
commit1f14b9f535682217d855ef382c3b85314066c5ab (patch)
tree7e4e78c2903b17fa7a6362d2490b7addad49b296 /actionview/test
parent09975bb24c56f00d47fce1b37dffe25be0a9a167 (diff)
parent0e50b7bdf4c0f789db37e22dc45c52b082f674b4 (diff)
downloadrails-1f14b9f535682217d855ef382c3b85314066c5ab.tar.gz
rails-1f14b9f535682217d855ef382c3b85314066c5ab.tar.bz2
rails-1f14b9f535682217d855ef382c3b85314066c5ab.zip
Merge pull request #17113 from igor04/helpers-highlight
Added processing of `nil` to `highlight` helper method
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/text_helper_test.rb4
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 667f9002da..f05b845e46 100644
--- a/actionview/test/template/text_helper_test.rb
+++ b/actionview/test/template/text_helper_test.rb
@@ -193,6 +193,10 @@ class TextHelperTest < ActionView::TestCase
assert_equal ' ', highlight(' ', 'blank text is returned verbatim')
end
+ def test_highlight_should_return_blank_string_for_nil
+ assert_equal '', highlight(nil, 'blank string is returned for nil')
+ end
+
def test_highlight_should_sanitize_input
assert_equal(
"This is a <mark>beautiful</mark> morning",