From ad56713504b3bb59d32e4f61d30c41fcab89db86 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Mon, 13 May 2013 17:51:44 +0100 Subject: 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. --- spec/lib/mail_handler/mail_handler_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/lib/mail_handler/mail_handler_spec.rb') 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 -- cgit v1.2.3