mirror of
https://github.com/github/rails.git
synced 2026-01-25 06:18:04 -05:00
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
This commit is contained in:
@@ -162,11 +162,19 @@ class TestMailer < ActionMailer::Base
|
||||
recipients recipient
|
||||
subject "nested multipart"
|
||||
from "test@example.com"
|
||||
body "multipart/mixed"
|
||||
content_type "multipart/mixed"
|
||||
part :content_type => "text/plain", :body => "hullo"
|
||||
attachment :content_type => "application/octet-stream", :body => "test abcdefghijklmnopqstuvwxyz"
|
||||
end
|
||||
|
||||
|
||||
def headers_with_nonalpha_chars(recipient)
|
||||
recipients recipient
|
||||
subject "nonalpha chars"
|
||||
from "One: Two <test@example.com>"
|
||||
cc "Three: Four <test@example.com>"
|
||||
bcc "Five: Six <test@example.com>"
|
||||
body "testing"
|
||||
end
|
||||
|
||||
class <<self
|
||||
attr_accessor :received_body
|
||||
@@ -635,5 +643,15 @@ EOF
|
||||
assert_match %r{Content-Type: application/octet-stream[^;]}, result
|
||||
assert_match %r{Content-Disposition: attachment[^;]}, result
|
||||
end
|
||||
|
||||
def test_headers_with_nonalpha_chars
|
||||
mail = TestMailer.create_headers_with_nonalpha_chars(@recipient)
|
||||
assert !mail.from_addrs.empty?
|
||||
assert !mail.cc_addrs.empty?
|
||||
assert !mail.bcc_addrs.empty?
|
||||
assert_match(/:/, mail.from_addrs.to_s)
|
||||
assert_match(/:/, mail.cc_addrs.to_s)
|
||||
assert_match(/:/, mail.bcc_addrs.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user