aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/incoming_message_spec.rb
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2010-03-10 01:25:12 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2010-03-15 13:42:37 +0000
commit24f2217493a7f761d25b3a2c401f1eb3d10b6f6a (patch)
treec347eaf3a43e9126d9be70f825922f9fd12a3636 /spec/models/incoming_message_spec.rb
parenta84d2fa67c106cd537302b13631bc56c785dbb22 (diff)
Support for Outlook TNEF files
Diffstat (limited to 'spec/models/incoming_message_spec.rb')
-rw-r--r--spec/models/incoming_message_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb
index 0cfdeac3a..411aa1d96 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -268,5 +268,23 @@ describe IncomingMessage, "when Outlook messages are attached to messages" do
end
end
+describe IncomingMessage, "when TNEF attachments are attached to messages" do
+ it "should flatten all the attachments out" do
+ mail_body = load_file_fixture('incoming-request-tnef-attachments.email')
+ mail = TMail::Mail.parse(mail_body)
+ mail.base64_decode
+
+ im = IncomingMessage.new
+ im.stub!(:mail).and_return(mail)
+ ir = InfoRequest.new
+ im.info_request = ir
+
+ attachments = im.get_attachments_for_display
+ attachments.size.should == 2
+ attachments[0].display_filename.should == 'FOI 09 02976i.doc'
+ attachments[1].display_filename.should == 'FOI 09 02976iii.doc'
+ end
+end
+