diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-05 13:59:35 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-05 16:22:53 -0700 |
commit | 2e757bc298cef715e5c56945161bbd84f2610729 (patch) | |
tree | c252a10dad3897ff09f1931a0bb0bb132c7dd375 /actionpack/test/template | |
parent | e9020b4b5dbd4a19e288c613a86c78e32010c361 (diff) | |
download | rails-2e757bc298cef715e5c56945161bbd84f2610729.tar.gz rails-2e757bc298cef715e5c56945161bbd84f2610729.tar.bz2 rails-2e757bc298cef715e5c56945161bbd84f2610729.zip |
do not return html safe strings from auto_link
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index d0d4286393..a4fcff5167 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -315,14 +315,20 @@ class TextHelperTest < ActionView::TestCase end end - def test_auto_link_should_be_html_safe + def test_auto_link_should_not_be_html_safe email_raw = 'santiago@wyeworks.com' link_raw = 'http://www.rubyonrails.org' - assert auto_link(nil).html_safe? - assert auto_link('').html_safe? - assert auto_link("#{link_raw} #{link_raw} #{link_raw}").html_safe? - assert auto_link("hello #{email_raw}").html_safe? + assert !auto_link(nil).html_safe?, 'should not be html safe' + assert !auto_link('').html_safe?, 'should not be html safe' + assert !auto_link("#{link_raw} #{link_raw} #{link_raw}").html_safe?, 'should not be html safe' + assert !auto_link("hello #{email_raw}").html_safe?, 'should not be html safe' + end + + def test_auto_link_email_address + email_raw = 'aaron@tenderlovemaking.com' + email_result = %{<a href="mailto:#{email_raw}">#{email_raw}</a>} + assert !auto_link_email_addresses(email_result).html_safe?, 'should not be html safe' end def test_auto_link |