aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/incoming-request-plain.email2
-rw-r--r--spec/models/request_mailer_spec.rb11
2 files changed, 11 insertions, 2 deletions
diff --git a/spec/fixtures/incoming-request-plain.email b/spec/fixtures/incoming-request-plain.email
index 9072b32cc..ce1c7caa7 100644
--- a/spec/fixtures/incoming-request-plain.email
+++ b/spec/fixtures/incoming-request-plain.email
@@ -9,7 +9,7 @@ No way! That's so totally a rubbish question. No way am I answering that.
The Geraldine Quango
-On Wed, Oct 24, 2007 at 11:30:06AM +0100, francis@flourish.org wrote:
+On Wed, Oct 24, 2007 at 11:30:06AM +0100, Francis wrote:
> Please let me know why Francis isn't getting ready to leave the house
> to go to the UN talk.
>
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb
index 030395a2d..8bac9e5da 100644
--- a/spec/models/request_mailer_spec.rb
+++ b/spec/models/request_mailer_spec.rb
@@ -13,7 +13,16 @@ describe RequestMailer, " when receiving incoming mail" do
ir.incoming_messages.size.should == 1
end
- it "should XXX when the email is not to any information request"
+ it "should bounce email to admin when the email is not to any information request" do
+ ir = info_requests(:fancy_dog_request)
+ receive_incoming_mail('incoming-request-plain.email', 'dummy@localhost')
+ ir.incoming_messages.size.should == 0
+
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 1
+ mail = deliveries[0]
+ mail.to.should == [ MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost') ]
+ end
end