diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-07-24 15:44:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-07-24 15:44:23 -0300 |
commit | 9caf2cbf268137113447ac8156b862b5d84063b5 (patch) | |
tree | 99082229f183775d0ea9533fec5515609bd5e3b2 /actionview/test | |
parent | d937a1175f10586b892842348c1d6ecaa47aad2e (diff) | |
parent | 6a387824775430fef2a0075ddd7b9d31e8c5cb48 (diff) | |
download | rails-9caf2cbf268137113447ac8156b862b5d84063b5.tar.gz rails-9caf2cbf268137113447ac8156b862b5d84063b5.tar.bz2 rails-9caf2cbf268137113447ac8156b862b5d84063b5.zip |
Merge pull request #21007 from clayton-shopify/fix-mailto-encoding
Encode the email address as prescribed in RFC 6068 section 2.
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/url_helper_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb index 0e35c67516..416d30938a 100644 --- a/actionview/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -500,6 +500,13 @@ class UrlHelperTest < ActiveSupport::TestCase mail_to("david@loudthinking.com", "David Heinemeier Hansson", class: "admin") end + def test_mail_to_with_special_characters + assert_dom_equal( + %{<a href="mailto:%23%21%24%25%26%27%2A%2B-%2F%3D%3F%5E_%60%7B%7D%7C%7E@example.org">#!$%&'*+-/=?^_`{}|~@example.org</a>}, + mail_to("#!$%&'*+-/=?^_`{}|~@example.org") + ) + end + def test_mail_with_options assert_dom_equal( %{<a href="mailto:me@example.com?cc=ccaddress%40example.com&bcc=bccaddress%40example.com&body=This%20is%20the%20body%20of%20the%20message.&subject=This%20is%20an%20example%20email&reply-to=foo%40bar.com">My email</a>}, |