mirror of
https://github.com/github/rails.git
synced 2026-01-29 00:08:15 -05:00
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
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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." # =>
|
||||
# <a href="mailto:me@domain.com?cc="ccaddress@domain.com"&bcc="bccaddress@domain.com"&body="This%20is%20the%20body%20of%20the%20message."&subject="This%20is%20an%20example%20email">My email</a>
|
||||
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")
|
||||
|
||||
@@ -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 %(<a href="mailto:feedback@example.com"><img src="/feedback.png" /></a>), mail_to('feedback@example.com', '<img src="/feedback.png" />')
|
||||
end
|
||||
|
||||
def test_mail_to_with_hex
|
||||
assert_dom_equal "<a href=\"mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d\">My email</a>", mail_to("me@domain.com", "My email", :encode => "hex")
|
||||
|
||||
Reference in New Issue
Block a user