Permalink
Browse files

Catching test bug where email state propagates beyond single test run

  • Loading branch information...
nahurst committed Mar 18, 2013
1 parent 8a1c9d5 commit 4b7b0819a234b754a41051d1fb4393b40b0e8762
Showing with 3 additions and 0 deletions.
  1. +1 −0 spec/controllers/mail_merges_controller_spec.rb
  2. +2 −0 spec/models/mail_merge_spec.rb
@@ -71,6 +71,7 @@ def valid_session
end
it "assigns a newly created mail_merge as @mail_merge" do
+ ActionMailer::Base.deliveries.clear
post :create, {:mail_merge => valid_attributes}, valid_session
assigns(:mail_merge).should be_a(MailMerge)
assigns(:mail_merge).should be_persisted
@@ -4,6 +4,8 @@
describe 'email generation' do
it 'should generate emails for a complete mail merge' do
+ ActionMailer::Base.deliveries.clear
+
mm = create(:mail_merge)
mm.emails.length.should == 4

0 comments on commit 4b7b081

Please sign in to comment.