aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/incoming_message_spec.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-03-09 14:41:05 +0000
committerFrancis Irving <francis@mysociety.org>2010-03-09 14:41:05 +0000
commit7c5be5afbc8af5fa3ab504983e4f38c09c71e118 (patch)
treee2167d321cb4ebff2fcf8f61aab6bc52532bb4c0 /spec/models/incoming_message_spec.rb
parent30bb6608984abdaf72350febc77fe9a982038138 (diff)
parent9d1321cca685d4a25cdb615199ef464da3ba4d5d (diff)
Merge commit 'peter/master'
Conflicts: config/environment.rb Merge patch from Peter Collingbourne for handling Outlook attachments.
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 47f089ca2..cf51c8a42 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -250,5 +250,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
+