diff options
author | Zach Brock <zbrock@gmail.com> | 2009-11-24 23:51:51 -0800 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2010-01-05 10:57:20 +1300 |
commit | 79438b46382aa08ea83d740247eb16365e6d2327 (patch) | |
tree | 2b03ebad4c612392e1dc9bc59d64a0f38a6d5d66 /actionpack/test/template | |
parent | ae270f597decb66444d91b27509c7dc1fc24a6b6 (diff) | |
download | rails-79438b46382aa08ea83d740247eb16365e6d2327.tar.gz rails-79438b46382aa08ea83d740247eb16365e6d2327.tar.bz2 rails-79438b46382aa08ea83d740247eb16365e6d2327.zip |
adding fix for auto linking to master too
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 08143ba680..088c07b8bb 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -360,6 +360,20 @@ class TextHelperTest < ActionView::TestCase assert_equal %(<p>#{link10_result} Link</p>), auto_link("<p>#{link10_raw} Link</p>") end + def test_auto_link_other_protocols + silence_warnings do + begin + old_re_value = ActionView::Helpers::TextHelper::AUTO_LINK_RE + ActionView::Helpers::TextHelper.const_set :AUTO_LINK_RE, %r{(ftp://)[^\s<]+} + link_raw = 'ftp://example.com/file.txt' + link_result = generate_result(link_raw) + assert_equal %(Download #{link_result}), auto_link("Download #{link_raw}") + ensure + ActionView::Helpers::TextHelper.const_set :AUTO_LINK_RE, old_re_value + end + end + end + def test_auto_link_already_linked linked1 = generate_result('Ruby On Rails', 'http://www.rubyonrails.com') linked2 = generate_result('www.rubyonrails.com', 'http://www.rubyonrails.com') |