diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2006-12-07 22:12:48 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2006-12-07 22:12:48 +0000 |
commit | 2f9d44e50beb7c51fd26bf900c4d18986c9ab754 (patch) | |
tree | 39cefc61f319902a016056620cee88bbfe67daf7 /actionpack/test/template | |
parent | 90179a9ba5622075d150b4decfe9716e0424d380 (diff) | |
download | rails-2f9d44e50beb7c51fd26bf900c4d18986c9ab754.tar.gz rails-2f9d44e50beb7c51fd26bf900c4d18986c9ab754.tar.bz2 rails-2f9d44e50beb7c51fd26bf900c4d18986c9ab754.zip |
Improved auto_link to match more valid urls correctly
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5704 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index bf008ae9df..37eff78e76 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -152,6 +152,10 @@ class TextHelperTest < Test::Unit::TestCase link4_result = %{<a href="#{link4_raw}">#{link4_raw}</a>} link5_raw = 'http://foo.example.com:3000/controller/action' link5_result = %{<a href="#{link5_raw}">#{link5_raw}</a>} + link6_raw = 'http://foo.example.com:3000/controller/action+pack' + link6_result = %{<a href="#{link6_raw}">#{link6_raw}</a>} + link7_raw = 'http://foo.example.com/controller/action?parm=value&p2=v2#anchor-123' + link7_result = %{<a href="#{link7_raw}">#{link7_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) @@ -177,6 +181,8 @@ class TextHelperTest < Test::Unit::TestCase assert_equal %(<p>Link #{link4_result}</p>), auto_link("<p>Link #{link4_raw}</p>") assert_equal %(<p>#{link4_result} Link</p>), auto_link("<p>#{link4_raw} Link</p>") assert_equal %(<p>#{link5_result} Link</p>), auto_link("<p>#{link5_raw} Link</p>") + assert_equal %(<p>#{link6_result} Link</p>), auto_link("<p>#{link6_raw} Link</p>") + assert_equal %(<p>#{link7_result} Link</p>), auto_link("<p>#{link7_raw} Link</p>") assert_equal '', auto_link(nil) assert_equal '', auto_link('') end |