From bc913fd3552cec8fde134b623a7dbabd9cccf7d6 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Mon, 22 Jul 2013 16:58:53 +1000 Subject: [PATCH] Reset ActionMailer::Base.deliveries at start of test - http://stackoverflow.com/questions/5843284/clearing-out-activemailerbase-deliveries-after-rspec-test --- .../enterprises_distributor_info_rich_text_feature_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb index 0162c35565..6ad553536a 100644 --- a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb +++ b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb @@ -51,6 +51,8 @@ feature "enterprises distributor info as rich text" do end scenario "viewing distributor info", js: true do + ActionMailer::Base.deliveries.clear + setup_shipping_details d = create(:distributor_enterprise, distributor_info: 'Chu ge sai yubi dan bisento tobi ashi yubi ge omote.', next_collection_at: 'Thursday 2nd May') @@ -76,9 +78,7 @@ feature "enterprises distributor info as rich text" do # -- Purchase email complete_purchase_from_checkout_address_page - sleep 2 # The default timeout for wait_until is not always enough here wait_until { ActionMailer::Base.deliveries.length == 1 } - ActionMailer::Base.deliveries.length.should == 1 email = ActionMailer::Base.deliveries.last email.body.should =~ /Chu ge sai yubi dan bisento tobi ashi yubi ge omote./ email.body.should =~ /Thursday 2nd May/