diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-01-15 17:04:06 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-01-15 17:04:06 +1100 |
commit | e6c80e93df44a436d9c94a9c076eb321df249b2a (patch) | |
tree | f2396181cfadeca370446f936f0bc4c1da3888dd /spec/models/foi_attachment_spec.rb | |
parent | b5f2bed1e406cd7fb6b50259a57be201c797db7d (diff) | |
parent | 843805e5d92eded943bd2a32b02ac967539245e8 (diff) |
Merge remote-tracking branch 'mysociety/develop' into rails_xss
Diffstat (limited to 'spec/models/foi_attachment_spec.rb')
-rw-r--r-- | spec/models/foi_attachment_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/foi_attachment_spec.rb b/spec/models/foi_attachment_spec.rb index 9d44957e4..537a3363c 100644 --- a/spec/models/foi_attachment_spec.rb +++ b/spec/models/foi_attachment_spec.rb @@ -30,6 +30,17 @@ describe FoiAttachment, " when calculating due date" do main.delete_cached_file! main = im.get_main_body_text_part main.body.should == orig_body - + end end + +describe FoiAttachment, "when ensuring a filename is present" do + + it 'should create a filename for an instance with a blank filename' do + attachment = FoiAttachment.new + attachment.filename = '' + attachment.ensure_filename! + attachment.filename.should == 'attachment.bin' + end + +end |