aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2015-06-04 13:58:23 +0100
committerGareth Rees <gareth@mysociety.org>2015-06-04 13:58:23 +0100
commit0ad3ef57d766dd6a8c37a172f9bc3b98114409c8 (patch)
tree2d1152dd6b53b059b7205f162a75181067877b06
parent1e8dc7d5cbb382f6cb94716fd1ff0c990d219792 (diff)
Correctly set uuencoded attachment file size2508-hotfix-bad-uudecode
-rw-r--r--app/models/incoming_message.rb3
-rw-r--r--spec/models/incoming_message_spec.rb1
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 2e697140c..3606c39c2 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -521,8 +521,7 @@ class IncomingMessage < ActiveRecord::Base
attachment = foi_attachments.find_or_create_by_hexdigest(hexdigest)
attachment.update_attributes(:filename => filename,
:content_type => content_type,
- :body => content,
- :display_size => "0K")
+ :body => content)
attachment.save!
attachments << attachment
end
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb
index e9929bac4..0fdc7b663 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -541,6 +541,7 @@ describe IncomingMessage, " when uudecoding bad messages" do
attachments = im.foi_attachments
attachments.size.should == 2
attachments[1].filename.should == 'ResponseT5741 15.doc'
+ attachments[1].display_size.should == '123K'
im.get_attachments_for_display.size.should == 1
end