diff options
Diffstat (limited to 'actionmailer/test')
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index b5d488a02b..04fa6bde1f 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -73,6 +73,14 @@ class TestMailer < ActionMailer::Base @body = "åœö blah" @charset = "utf-8" end + + class <<self + attr_accessor :received_body + end + + def receive(mail) + self.class.received_body = mail.body + end end TestMailer.template_root = File.dirname(__FILE__) + "/fixtures" @@ -307,5 +315,11 @@ EOF assert_match(/\nTo: =\?utf-8\?Q\?Foo_.*?\?= <extended@example.net>, Example Recipient <me/, created.encoded) end + def test_receive_decodes_base64_encoded_mail + fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email") + TestMailer.receive(fixture) + assert_match(/Jamis/, TestMailer.received_body) + end + end |