diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-02-09 13:21:56 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-02-09 13:21:56 +0000 |
commit | 308707f1512fc43c570023ee786463d37e43f1fb (patch) | |
tree | ea7ebdaaf9988a8adfa91b8ff2b496a92a6624f9 /spec/models/incoming_message_spec.rb | |
parent | b1a683778e817005751ac08654d17366d4cda624 (diff) | |
parent | 46646f8e659dc3c567495424088eb66e6ef2feee (diff) |
Merge branch 'release/0.5.1'
Conflicts:
README.md
Diffstat (limited to 'spec/models/incoming_message_spec.rb')
-rw-r--r-- | spec/models/incoming_message_spec.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index b6fee7898..6cfd2eb64 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -362,6 +362,7 @@ describe IncomingMessage, " when uudecoding bad messages" do im = incoming_messages(:useless_incoming_message) im.stub!(:mail).and_return(mail) im.extract_attachments! + attachments = im.foi_attachments attachments.size.should == 2 attachments[1].filename.should == 'moo.txt' @@ -385,9 +386,9 @@ describe IncomingMessage, " when uudecoding bad messages" do ir.censor_rules << @censor_rule im.extract_attachments! - attachments = im.get_attachments_for_display - attachments.size.should == 1 - attachments[0].display_filename.should == 'bah.txt' + im.get_attachments_for_display.map(&:display_filename).should == [ + 'bah.txt', + ] end end @@ -409,10 +410,11 @@ describe IncomingMessage, "when messages are attached to messages" do im.extract_attachments! attachments = im.get_attachments_for_display - attachments.size.should == 3 - attachments[0].display_filename.should == 'Same attachment twice.txt' - attachments[1].display_filename.should == 'hello.txt' - attachments[2].display_filename.should == 'hello.txt' + attachments.map(&:display_filename).should == [ + 'Same attachment twice.txt', + 'hello.txt', + 'hello.txt', + ] end end @@ -431,10 +433,10 @@ describe IncomingMessage, "when Outlook messages are attached to messages" do im.stub!(:mail).and_return(mail) im.extract_attachments! - attachments = im.get_attachments_for_display - attachments.size.should == 2 - attachments[0].display_filename.should == 'test.html' # picks HTML rather than text by default, as likely to render better - attachments[1].display_filename.should == 'attach.txt' + im.get_attachments_for_display.map(&:display_filename).should == [ + 'test.html', # picks HTML rather than text by default, as likely to render better + 'attach.txt', + ] end end @@ -453,12 +455,10 @@ describe IncomingMessage, "when TNEF attachments are attached to messages" do im.stub!(:mail).and_return(mail) im.extract_attachments! - attachments = im.get_attachments_for_display - attachments.size.should == 2 - attachments[0].display_filename.should == 'FOI 09 02976i.doc' - attachments[1].display_filename.should == 'FOI 09 02976iii.doc' + im.get_attachments_for_display.map(&:display_filename).should == [ + 'FOI 09 02976i.doc', + 'FOI 09 02976iii.doc', + ] end end - - |