aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/mail_service_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-11 11:46:12 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-11 11:46:12 +0000
commita67beac9d0db8e7dd88267ac5eeefc49ffbd46ce (patch)
treeb66bfd77207084141ddc2a695b3a87bc98f8bddb /actionmailer/test/mail_service_test.rb
parent256e800a0125cdd724bb7bdefc091f36b872896f (diff)
downloadrails-a67beac9d0db8e7dd88267ac5eeefc49ffbd46ce.tar.gz
rails-a67beac9d0db8e7dd88267ac5eeefc49ffbd46ce.tar.bz2
rails-a67beac9d0db8e7dd88267ac5eeefc49ffbd46ce.zip
Dont quote the body
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test/mail_service_test.rb')
-rwxr-xr-xactionmailer/test/mail_service_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index 31169d576a..bebbdba473 100755
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -63,6 +63,16 @@ class TestMailer < ActionMailer::Base
@charset = "iso-8859-1"
end
+ def utf8_body(recipient)
+ @recipients = recipient
+ @subject = "testing utf-8 body"
+ @from = "김치통 <kimchi@example.net.kr>"
+ @sent_on = Time.local 2004, 12, 12
+ @cc = "김치통 <kimchi@example.net.kr>"
+ @bcc = "김치통 <kimchi@example.net.kr>"
+ @body = "안녕하세요!"
+ @charset = "utf-8"
+ end
end
TestMailer.template_root = File.dirname(__FILE__) + "/fixtures"
@@ -265,6 +275,21 @@ EOF
assert_not_nil ActionMailer::Base.deliveries.first
assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
end
+
+ def test_utf8_body_is_not_quoted
+ @recipient = "김치통 <kimchi@example.net.kr>"
+ expected = new_mail "utf-8"
+ expected.to = TestMailer.quote_address_if_necessary @recipient, "utf-8"
+ expected.subject = "testing utf-8 body"
+ expected.body = "안녕하세요!"
+ expected.from = TestMailer.quote_address_if_necessary @recipient, "utf-8"
+ expected.cc = TestMailer.quote_address_if_necessary @recipient, "utf-8"
+ expected.bcc = TestMailer.quote_address_if_necessary @recipient, "utf-8"
+ expected.date = Time.local 2004, 12, 12
+
+ created = TestMailer.create_utf8_body @recipient
+ assert_match(/안녕하세요!/, created.encoded)
+ end
end