Skip to content
This repository
Browse code

Added unit test to confirm that #1393 is fixed in HEAD

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit e85369ed7aa809e66c5829dca5ffcfdff867fb98 1 parent 06052cb
Jamis Buck jamis authored

Showing 1 changed file with 20 additions and 2 deletions. Show diff stats Hide diff stats

  1. +20 2 actionmailer/test/mail_service_test.rb
22 actionmailer/test/mail_service_test.rb
@@ -162,11 +162,19 @@ def unnamed_attachment(recipient)
162 162 recipients recipient
163 163 subject "nested multipart"
164 164 from "test@example.com"
165   - body "multipart/mixed"
  165 + content_type "multipart/mixed"
166 166 part :content_type => "text/plain", :body => "hullo"
167 167 attachment :content_type => "application/octet-stream", :body => "test abcdefghijklmnopqstuvwxyz"
168 168 end
169   -
  169 +
  170 + def headers_with_nonalpha_chars(recipient)
  171 + recipients recipient
  172 + subject "nonalpha chars"
  173 + from "One: Two <test@example.com>"
  174 + cc "Three: Four <test@example.com>"
  175 + bcc "Five: Six <test@example.com>"
  176 + body "testing"
  177 + end
170 178
171 179 class <<self
172 180 attr_accessor :received_body
@@ -635,5 +643,15 @@ def test_empty_header_values_omitted
635 643 assert_match %r{Content-Type: application/octet-stream[^;]}, result
636 644 assert_match %r{Content-Disposition: attachment[^;]}, result
637 645 end
  646 +
  647 + def test_headers_with_nonalpha_chars
  648 + mail = TestMailer.create_headers_with_nonalpha_chars(@recipient)
  649 + assert !mail.from_addrs.empty?
  650 + assert !mail.cc_addrs.empty?
  651 + assert !mail.bcc_addrs.empty?
  652 + assert_match(/:/, mail.from_addrs.to_s)
  653 + assert_match(/:/, mail.cc_addrs.to_s)
  654 + assert_match(/:/, mail.bcc_addrs.to_s)
  655 + end
638 656 end
639 657

0 comments on commit e85369e

Please sign in to comment.
Something went wrong with that request. Please try again.