aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorAlexey Vakhov <vakhov@gmail.com>2011-11-10 11:26:42 +0400
committerAlexey Vakhov <vakhov@gmail.com>2011-11-10 11:26:42 +0400
commitb5c3987294d3860a78b1b04ee49b2b55f3cdc614 (patch)
treebbac035f432d7eacbb37d222a08700e87664efbd /actionpack/test/template/text_helper_test.rb
parenta625523e755421b0f96fe5b0a885462ef51582b1 (diff)
downloadrails-b5c3987294d3860a78b1b04ee49b2b55f3cdc614.tar.gz
rails-b5c3987294d3860a78b1b04ee49b2b55f3cdc614.tar.bz2
rails-b5c3987294d3860a78b1b04ee49b2b55f3cdc614.zip
Fix and simplify highlight regexp
Diffstat (limited to 'actionpack/test/template/text_helper_test.rb')
-rw-r--r--actionpack/test/template/text_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 02f9609483..a0afb77f05 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -194,6 +194,10 @@ class TextHelperTest < ActionView::TestCase
"<p>This is a <strong class=\"highlight\">beautiful</strong> <a href=\"http://example.com/beautiful#top?what=beautiful%20morning&amp;when=now+then\">morning</a>, but also a <strong class=\"highlight\">beautiful</strong> day</p>",
highlight("<p>This is a beautiful <a href=\"http://example.com/beautiful\#top?what=beautiful%20morning&when=now+then\">morning</a>, but also a beautiful day</p>", "beautiful")
)
+ assert_equal(
+ "<div>abc <b>div</b></div>",
+ highlight("<div>abc div</div>", "div", :highlighter => '<b>\1</b>')
+ )
end
def test_excerpt