From 09e76e6acacb5f90dfc67d50c44b8257d36c4e95 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 20 Sep 2007 20:40:22 +0000 Subject: Autolink behaves well with emails embedded in URLs. Closes #7313. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7516 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/text_helper_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 1f5b90e811..1e80d030ec 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -157,6 +157,7 @@ class TextHelperTest < Test::Unit::TestCase http://www.rubyonrails.com/contact;new?with=query&string=params http://www.rubyonrails.com/~minam/contact;new?with=query&string=params http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured_picture_%28animation%29/January_20%2C_2007 + http://www.mail-archive.com/rails@lists.rubyonrails.org/ ) urls.each do |url| @@ -167,6 +168,8 @@ class TextHelperTest < Test::Unit::TestCase def test_auto_linking email_raw = 'david@loudthinking.com' email_result = %{#{email_raw}} + email2_raw = '+david@loudthinking.com' + email2_result = %{#{email2_raw}} link_raw = 'http://www.rubyonrails.com' link_result = %{#{link_raw}} link_result_with_options = %{#{link_raw}} @@ -186,6 +189,8 @@ class TextHelperTest < Test::Unit::TestCase link8_result = %{#{link8_raw}} link9_raw = 'http://business.timesonline.co.uk/article/0,,9065-2473189,00.html' link9_result = %{#{link9_raw}} + link10_raw = 'http://www.mail-archive.com/ruby-talk@ruby-lang.org/' + link10_result = %{#{link10_raw}} assert_equal %(hello #{email_result}), auto_link("hello #{email_raw}", :email_addresses) assert_equal %(Go to #{link_result}), auto_link("Go to #{link_raw}", :urls) @@ -225,6 +230,8 @@ class TextHelperTest < Test::Unit::TestCase assert_equal %(

#{link9_result} Link

), auto_link("

#{link9_raw} Link

") assert_equal %(Go to #{link9_result}.), auto_link(%(Go to #{link9_raw}.)) assert_equal %(

Go to #{link9_result}. seriously, #{link9_result}? i think I'll say hello to #{email_result}. instead.

), auto_link(%(

Go to #{link9_raw}. seriously, #{link9_raw}? i think I'll say hello to #{email_raw}. instead.

)) + assert_equal %(

#{link10_result} Link

), auto_link("

#{link10_raw} Link

") + assert_equal email2_result, auto_link(email2_raw) assert_equal '', auto_link(nil) assert_equal '', auto_link('') end -- cgit v1.2.3