aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/text_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index ef6c837c9f..d43bc43b9c 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -161,6 +161,13 @@ class TextHelperTest < Test::Unit::TestCase
assert_equal %(<p><a href="#{url1}">#{url1}</a><br /><a href="#{url2}">#{url2}</a><br /></p>), auto_link("<p>#{url1}<br />#{url2}<br /></p>")
end
+ def test_auto_link_with_block
+ url = "http://api.rubyonrails.com/Foo.html"
+ email = "fantabulous@shiznadel.ic"
+
+ assert_equal %(<p><a href="#{url}">#{url[0..7]}...</a><br /><a href="mailto:#{email}">#{email[0..7]}...</a><br /></p>), auto_link("<p>#{url}<br />#{email}<br /></p>") { |url| truncate(url, 10) }
+ end
+
def test_sanitize_form
raw = "<form action=\"/foo/bar\" method=\"post\"><input></form>"
result = sanitize(raw)