diff options
author | francis <francis> | 2008-07-08 09:41:04 +0000 |
---|---|---|
committer | francis <francis> | 2008-07-08 09:41:04 +0000 |
commit | 1aeaee94a47c6a912082f60085e130dac330bd19 (patch) | |
tree | efe41d77c1d3390a8641ac354047fc9a426e2aa1 /spec/models | |
parent | 7028e3cce83ce9e86d9620076257244a39585d7a (diff) |
Store incoming messages which aren't to a valid request in a holding pen, and
let people move them from admin interface.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/request_mailer_spec.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb index 98c27cca9..2a882b7c7 100644 --- a/spec/models/request_mailer_spec.rb +++ b/spec/models/request_mailer_spec.rb @@ -13,12 +13,19 @@ describe RequestMailer, " when receiving incoming mail" do receive_incoming_mail('incoming-request-plain.email', ir.incoming_email) ir.incoming_messages.size.should == 2 # one more arrives ir.info_request_events[-1].incoming_message_id.should_not be_nil + + deliveries = ActionMailer::Base.deliveries + deliveries.size.should == 1 + deliveries.clear end - it "should bounce email to admin when the email is not to any information request" do + it "should store mail in holding pen and send to admin when the email is not to any information request" do ir = info_requests(:fancy_dog_request) + ir.incoming_messages.size.should == 1 + InfoRequest.holding_pen_request.incoming_messages.size.should == 0 receive_incoming_mail('incoming-request-plain.email', 'dummy@localhost') ir.incoming_messages.size.should == 1 + InfoRequest.holding_pen_request.incoming_messages.size.should == 1 deliveries = ActionMailer::Base.deliveries deliveries.size.should == 1 |