From e27f7a43016544460159a9a268ee9046644b45cf Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 25 Mar 2020 08:42:21 +0100 Subject: [PATCH] Ensure perform_deliveries is correctly set when testing user confirmation emails --- spec/models/spree/user_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/models/spree/user_spec.rb b/spec/models/spree/user_spec.rb index d73042c67a4..7ed818fee28 100644 --- a/spec/models/spree/user_spec.rb +++ b/spec/models/spree/user_spec.rb @@ -76,9 +76,11 @@ it "should send a confirmation email" do setup_email - expect do - create(:user, email: 'new_user@example.com', confirmation_sent_at: nil, confirmed_at: nil) - end.to send_confirmation_instructions + performing_deliveries do + expect do + create(:user, email: 'new_user@example.com', confirmation_sent_at: nil, confirmed_at: nil) + end.to send_confirmation_instructions + end sent_mail = ActionMailer::Base.deliveries.last expect(sent_mail.to).to eq ['new_user@example.com']