From bdf91d67484bd836dc34d54b5565ea05dbb37f20 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Sat, 2 Sep 2006 01:47:32 +0000 Subject: Make auto_link parse a greater subset of valid url formats. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/text_helper_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 0333e974b8..babb68ccfa 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -114,6 +114,24 @@ class TextHelperTest < Test::Unit::TestCase assert_equal("2 counts", pluralize(2, "count")) end + def test_auto_link_parsing + urls = %w(http://www.rubyonrails.com + http://www.rubyonrails.com:80 + http://www.rubyonrails.com/~minam + https://www.rubyonrails.com/~minam + http://www.rubyonrails.com/~minam/url%20with%20spaces + http://www.rubyonrails.com/foo.cgi?something=here + http://www.rubyonrails.com/foo.cgi?something=here&and=here + http://www.rubyonrails.com/contact;new + http://www.rubyonrails.com/contact;new%20with%20spaces + http://www.rubyonrails.com/contact;new?with=query&string=params + http://www.rubyonrails.com/~minam/contact;new?with=query&string=params) + + urls.each do |url| + assert_equal %(#{url}), auto_link(url) + end + end + def test_auto_linking email_raw = 'david@loudthinking.com' email_result = %{#{email_raw}} -- cgit v1.2.3