diff options
-rw-r--r-- | spec/lib/sendmail_return_path_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/tmail_extensions_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/track_mailer_spec.rb | 7 |
3 files changed, 20 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 diff --git a/spec/models/track_mailer_spec.rb b/spec/models/track_mailer_spec.rb index 83bbc4c13..02f3bc991 100644 --- a/spec/models/track_mailer_spec.rb +++ b/spec/models/track_mailer_spec.rb @@ -114,6 +114,13 @@ describe TrackMailer do TrackMailer.deliver_event_digest(@user, []) # no items in it email for minimal test deliveries = ActionMailer::Base.deliveries + if deliveries.size > 1 # debugging if there is an error + deliveries.each do |d| + STDERR.puts "------------------------------" + STDERR.puts d.body + STDERR.puts "------------------------------" + end + end deliveries.size.should == 1 mail = deliveries[0] |