aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorAndrew Kaspick <andrew@redlinesoftware.com>2008-11-19 12:55:27 -0600
committerMichael Koziarski <michael@koziarski.com>2008-12-01 19:27:03 +0100
commitbda55f82c687920807f606a2b024f1882094ef1e (patch)
tree953bce745ee12b86bf471814ff7adf54548da393 /actionpack/test/template/text_helper_test.rb
parent25f6524b89900378d08de9ec45757813dbb650cf (diff)
downloadrails-bda55f82c687920807f606a2b024f1882094ef1e.tar.gz
rails-bda55f82c687920807f606a2b024f1882094ef1e.tar.bz2
rails-bda55f82c687920807f606a2b024f1882094ef1e.zip
allow options to be passed to email address auto generation
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1418 state:committed]
Diffstat (limited to 'actionpack/test/template/text_helper_test.rb')
-rw-r--r--actionpack/test/template/text_helper_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 3e7a8f3e44..a6200fbdd7 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -262,6 +262,11 @@ class TextHelperTest < ActionView::TestCase
email2_result = %{<a href="mailto:#{email2_raw}">#{email2_raw}</a>}
assert_equal email2_result, auto_link(email2_raw)
+ email3_raw = '+david@loudthinking.com'
+ email3_result = %{<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;+%64%61%76%69%64@%6c%6f%75%64%74%68%69%6e%6b%69%6e%67.%63%6f%6d">#{email3_raw}</a>}
+ assert_equal email3_result, auto_link(email3_raw, :all, :encode => :hex)
+ assert_equal email3_result, auto_link(email3_raw, :email_addresses, :encode => :hex)
+
link2_raw = 'www.rubyonrails.com'
link2_result = generate_result(link2_raw, "http://#{link2_raw}")
assert_equal %(Go to #{link2_result}), auto_link("Go to #{link2_raw}", :urls)
@@ -362,7 +367,7 @@ class TextHelperTest < ActionView::TestCase
end
def test_auto_link_with_options_hash
- assert_dom_equal 'Welcome to my new blog at <a href="http://www.myblog.com/" class="menu" target="_blank">http://www.myblog.com/</a>. Please e-mail me at <a href="mailto:me@email.com">me@email.com</a>.',
+ assert_dom_equal 'Welcome to my new blog at <a href="http://www.myblog.com/" class="menu" target="_blank">http://www.myblog.com/</a>. Please e-mail me at <a href="mailto:me@email.com" class="menu" target="_blank">me@email.com</a>.',
auto_link("Welcome to my new blog at http://www.myblog.com/. Please e-mail me at me@email.com.",
:link => :all, :html => { :class => "menu", :target => "_blank" })
end