aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorigor04 <igor.s04g@gmail.com>2014-09-30 14:48:48 +0300
committerigor04 <igor.s04g@gmail.com>2014-09-30 14:48:48 +0300
commit0e50b7bdf4c0f789db37e22dc45c52b082f674b4 (patch)
treeef51bfae7d593ab269f00d3618f07df1387d13d5 /actionview/test
parent79c491e838f83b027b093242cdaf22f47935c258 (diff)
downloadrails-0e50b7bdf4c0f789db37e22dc45c52b082f674b4.tar.gz
rails-0e50b7bdf4c0f789db37e22dc45c52b082f674b4.tar.bz2
rails-0e50b7bdf4c0f789db37e22dc45c52b082f674b4.zip
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",