aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-06-16 05:42:47 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-06-16 05:42:47 +0000
commit691562746f277aa0453ec9fdc06fad5a59210fb5 (patch)
tree356af3e5c49511d7cb40d5f4d855249e5a3cb3e0 /actionpack/test/template/text_helper_test.rb
parentbfe6a759c25ad02b4bfcb2dd16999d8ba72e2df8 (diff)
downloadrails-691562746f277aa0453ec9fdc06fad5a59210fb5.tar.gz
rails-691562746f277aa0453ec9fdc06fad5a59210fb5.tar.bz2
rails-691562746f277aa0453ec9fdc06fad5a59210fb5.zip
Fixed TextHelper#highlight to return the text, not nil, if the phrase is blank #1409 [patrick@lenz.sh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1429 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/text_helper_test.rb')
-rw-r--r--actionpack/test/template/text_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 926ebdaf47..81aca6f638 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -35,6 +35,11 @@ class TextHelperTest < Test::Unit::TestCase
"This is a <b>beautiful</b> morning, but also a <b>beautiful</b> day",
highlight("This is a beautiful morning, but also a beautiful day", "beautiful", '<b>\1</b>')
)
+
+ assert_equal(
+ "This text is not changed because we supplied an empty phrase",
+ highlight("This text is not changed because we supplied an empty phrase", nil)
+ )
end
def test_highlighter_with_regexp