aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/foi_attachment_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-17 08:48:41 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-17 08:48:41 +0000
commite60d21cb129d1de487ebedd6b5e9efb22913130d (patch)
treeaa1f987ff0d92b2d819f39d89afe2d3d6d821679 /spec/models/foi_attachment_spec.rb
parent9ab3cf355db5b8b6c558aea4744c2803fa658176 (diff)
parentbae21e38242aac2c5843bae5ea5fe3b09408a4f9 (diff)
Merge branch 'release/0.5' into develop
Diffstat (limited to 'spec/models/foi_attachment_spec.rb')
-rw-r--r--spec/models/foi_attachment_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/foi_attachment_spec.rb b/spec/models/foi_attachment_spec.rb
index d8166dddc..05c4fc5fd 100644
--- a/spec/models/foi_attachment_spec.rb
+++ b/spec/models/foi_attachment_spec.rb
@@ -20,17 +20,17 @@ describe FoiAttachment, " when calculating due date" do
attachment.display_size.should == "0K"
end
it "reparses the body if it disappears" do
- mail_body = load_file_fixture('incoming-request-attach-attachments.email')
- mail = TMail::Mail.parse(mail_body)
- mail.base64_decode
im = incoming_messages(:useless_incoming_message)
- im.stub!(:mail).and_return(mail)
- #im.extract_attachments!
- attachments = im.get_attachments_for_display
- FileUtils.rm attachments[0].filepath
+ im.extract_attachments!
+ main = im.get_main_body_text_part
+ orig_body = main.body
+ main.delete_cached_file!
lambda {
- attachments = im.get_attachments_for_display
- body = attachments[0].body
+ im.get_main_body_text_part.body
}.should_not raise_error(Errno::ENOENT)
+ main.delete_cached_file!
+ main = im.get_main_body_text_part
+ main.body.should == orig_body
+
end
end