aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2009-12-04 02:24:21 +0000
committerFrancis Irving <francis@mysociety.org>2009-12-04 02:24:21 +0000
commit3ffcf940f089f0d3c6a8cc9ca8c88803010bc415 (patch)
treedb291f3f1004db4a192125b4c44a7b303d6000a8 /spec/lib
parent1a5da559986b874c2ddcd5bf9a1940e947d784bc (diff)
Correctly take delivery of mail in new test
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/sendmail_return_path_spec.rb6
-rw-r--r--spec/lib/tmail_extensions_spec.rb8
2 files changed, 13 insertions, 1 deletions
diff --git a/spec/lib/sendmail_return_path_spec.rb b/spec/lib/sendmail_return_path_spec.rb
index 644372256..6556d0888 100644
--- a/spec/lib/sendmail_return_path_spec.rb
+++ b/spec/lib/sendmail_return_path_spec.rb
@@ -32,6 +32,9 @@ describe "when sending email with an altered return path" do
"This is just a test for a test script", nil, nil, nil
)
end
+
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 0
end
it "should set the return path when sending email using sendmail" do
@@ -44,6 +47,9 @@ describe "when sending email with an altered return path" do
)
end
end
+
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 0
end
diff --git a/spec/lib/tmail_extensions_spec.rb b/spec/lib/tmail_extensions_spec.rb
index 7b9e1b495..1c913283a 100644
--- a/spec/lib/tmail_extensions_spec.rb
+++ b/spec/lib/tmail_extensions_spec.rb
@@ -1,4 +1,5 @@
-# This is a test of the monkey patches in lib/fcgi_fixes.rb
+# This is a test of the set_content_type monkey patch in
+# lib/tmail_extensions.rb
require File.dirname(__FILE__) + '/../spec_helper'
@@ -10,6 +11,11 @@ describe "when using TMail" do
receive_incoming_mail("humberside-police-odd-mime-type.email", 'dummy')
InfoRequest.holding_pen_request.incoming_messages.size.should == 1
+ # clear the notification of new message in holding pen
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 1
+ deliveries.clear
+
incoming_message = InfoRequest.holding_pen_request.incoming_messages[0]
# This will raise an error if the bug in TMail hasn't been fixed