aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/incoming_message_spec.rb
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2010-02-18 02:26:35 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2010-02-18 02:31:34 +0000
commit9d1321cca685d4a25cdb615199ef464da3ba4d5d (patch)
treeec0cefe7fbe5ce4f8f747b4ce2fe2e6c13f4a6b8 /spec/models/incoming_message_spec.rb
parent095548ee5509980a6930c4bb0d160f34ffb1952f (diff)
Implement decoding of Outlook msg/oft 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 71d8da647..cf8db63cb 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -247,5 +247,23 @@ describe IncomingMessage, "when messages are attached to messages" do
end
end
+describe IncomingMessage, "when Outlook messages are attached to messages" do
+ it "should flatten all the attachments out" do
+ mail_body = load_file_fixture('incoming-request-oft-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 == 'test.txt'
+ attachments[1].display_filename.should == 'attach.txt'
+ end
+end
+