aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-09-02 23:52:01 +0000
committerMichael Koziarski <michael@koziarski.com>2007-09-02 23:52:01 +0000
commita79ac12c4e81c33991f079d6993ad5141190c17c (patch)
tree4e37b0fd799c4bb716de62ec947d9f996abeaf12 /actionpack/test/template/text_helper_test.rb
parentbde8be41fb3141e33dc86e24fa3fe6200cbb9e87 (diff)
downloadrails-a79ac12c4e81c33991f079d6993ad5141190c17c.tar.gz
rails-a79ac12c4e81c33991f079d6993ad5141190c17c.tar.bz2
rails-a79ac12c4e81c33991f079d6993ad5141190c17c.zip
Make auto link behave well with URLs containing email addresses. Closes #7313 [jeremymcnally]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 1f5b90e811..e0bbc32a7b 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|
@@ -186,6 +187,8 @@ class TextHelperTest < Test::Unit::TestCase
link8_result = %{<a href="#{link8_raw}">#{link8_raw}</a>}
link9_raw = 'http://business.timesonline.co.uk/article/0,,9065-2473189,00.html'
link9_result = %{<a href="#{link9_raw}">#{link9_raw}</a>}
+ link10_raw = 'http://www.mail-archive.com/ruby-talk@ruby-lang.org/'
+ link10_result = %{<a href="#{link10_raw}">#{link10_raw}</a>}
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 +228,7 @@ class TextHelperTest < Test::Unit::TestCase
assert_equal %(<p>#{link9_result} Link</p>), auto_link("<p>#{link9_raw} Link</p>")
assert_equal %(Go to #{link9_result}.), auto_link(%(Go to #{link9_raw}.))
assert_equal %(<p>Go to #{link9_result}. seriously, #{link9_result}? i think I'll say hello to #{email_result}. instead.</p>), auto_link(%(<p>Go to #{link9_raw}. seriously, #{link9_raw}? i think I'll say hello to #{email_raw}. instead.</p>))
+ assert_equal %(<p>#{link10_result} Link</p>), auto_link("<p>#{link10_raw} Link</p>")
assert_equal '', auto_link(nil)
assert_equal '', auto_link('')
end