aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/mail_handler
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-05-13 17:51:44 +0100
committerMark Longair <mhl@pobox.com>2013-05-16 09:06:27 +0100
commitad56713504b3bb59d32e4f61d30c41fcab89db86 (patch)
treece77eaed38a449407ad691ae79eb623dbbbc9289 /spec/lib/mail_handler
parent6b973b1d59b5c384a4ca5a5c0c2c53ad43159ad0 (diff)
Add another mail parsing test
At one point in development this email was misparsed, so I've added this as test to check for regressions.
Diffstat (limited to 'spec/lib/mail_handler')
-rw-r--r--spec/lib/mail_handler/mail_handler_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb
index 2a083d65c..048bc3eaf 100644
--- a/spec/lib/mail_handler/mail_handler_spec.rb
+++ b/spec/lib/mail_handler/mail_handler_spec.rb
@@ -297,6 +297,13 @@ describe 'when getting attachment attributes' do
attributes.size.should == 2
end
+ it 'should get one attachment from a multipart mail with text and HTML alternatives, which should be UTF-8' do
+ mail = get_fixture_mail('iso8859_2_raw_email.email')
+ attributes = MailHandler.get_attachment_attributes(mail)
+ attributes.length.should == 1
+ attributes[0][:body].is_utf8?.should == true
+ end
+
it 'should expand a mail attached as text' do
# Note that this spec will only pass using Tmail in the timezone set as datetime headers
# are rendered out in the local time - using the Mail gem this is not necessary