From 2b617783ad37e1f008499ba8389f50d67e7b78b1 Mon Sep 17 00:00:00 2001 From: Jan Szumiec Date: Wed, 7 Aug 2013 13:14:28 +0100 Subject: excerpt() now accepts regular expression instances as phrases. --- actionview/test/template/text_helper_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionview/test/template') diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index a514bba83d..b3bcf4d67b 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -264,6 +264,8 @@ class TextHelperTest < ActionView::TestCase assert_equal("...is a beautiful morn...", excerpt("This is a beautiful morning", "beautiful", :radius => 5)) assert_equal("This is a...", excerpt("This is a beautiful morning", "this", :radius => 5)) assert_equal("...iful morning", excerpt("This is a beautiful morning", "morning", :radius => 5)) + assert_equal("...udge Allen and...", excerpt("This day was challenging for judge Allen and his colleagues.", /\ballen\b/i, :radius => 5)) + assert_equal("...judge Allen and...", excerpt("This day was challenging for judge Allen and his colleagues.", /\ballen\b/i, :radius => 1, :separator => ' ')) assert_nil excerpt("This is a beautiful morning", "day") end -- cgit v1.2.3