From ab9f32442318ab306df3c5282da56e50cf807d8a Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Sun, 19 Mar 2006 17:03:02 +0000 Subject: [PATCH] Undo accidental escaping for mail_to; add regression test. Fix incorrect credit in changelog. Closes #4202. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3976 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 4 +++- actionpack/lib/action_view/helpers/url_helper.rb | 1 - actionpack/test/template/url_helper_test.rb | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index ec69d07b12..82a00d166b 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Undo accidental escaping for mail_to; add regression test. [Nicholas Seckar] + * Added nicer message for assert_redirected_to (closes #4294) [court3nay] assert_redirected_to :action => 'other_host', :only_path => false @@ -12,7 +14,7 @@ response is not a redirection to all of the options supplied (redirection is <{:only_path=>false, :host=>"other.test.host", :action=>"other_host"}>), difference: <{:only_path=>"true", :host=>"other.test.host"}> -* Change url_for to escape the resulting URLs when called from a view. [Nicholas Seckar, eddiewould@paradise.net.nz] +* Change url_for to escape the resulting URLs when called from a view. [Nicholas Seckar, coffee2code] * Added easy support for testing file uploads with fixture_file_upload #4105 [turnip@turnipspatch.com]. Example: diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index c4c8fca98e..ae5f0c230d 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -196,7 +196,6 @@ module ActionView # mail_to "me@domain.com", "My email", :cc => "ccaddress@domain.com", :bcc => "bccaddress@domain.com", :subject => "This is an example email", :body => "This is the body of the message." # => # My email def mail_to(email_address, name = nil, html_options = {}) - name = html_escape(name) if name html_options = html_options.stringify_keys encode = html_options.delete("encode") cc, bcc, subject, body = html_options.delete("cc"), html_options.delete("bcc"), html_options.delete("subject"), html_options.delete("body") diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 95b9373c7f..2c7a526315 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -193,6 +193,10 @@ class UrlHelperTest < Test::Unit::TestCase mail_to("me@example.com", "My email", :cc => "ccaddress@example.com", :bcc => "bccaddress@example.com", :subject => "This is an example email", :body => "This is the body of the message.") ) end + + def test_mail_to_with_img + assert_dom_equal %(), mail_to('feedback@example.com', '') + end def test_mail_to_with_hex assert_dom_equal "My email", mail_to("me@domain.com", "My email", :encode => "hex")