From f7b6867c28fd29d1f1a522d5f3dc0f2cffc6150a Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Mon, 5 Nov 2018 17:49:08 +0000 Subject: [PATCH] Perform mail delivery in spec to make it pass We need to purposefully enable deliveries for the deliveries array to list this email. Otherwise the delivery logic is not executed and thus the deliveries array never filled. --- spec/controllers/spree/admin/orders_controller_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/controllers/spree/admin/orders_controller_spec.rb b/spec/controllers/spree/admin/orders_controller_spec.rb index bc6a738967..7730f930fe 100644 --- a/spec/controllers/spree/admin/orders_controller_spec.rb +++ b/spec/controllers/spree/admin/orders_controller_spec.rb @@ -182,7 +182,9 @@ describe Spree::Admin::OrdersController, type: :controller do before { distributor.update_attribute(:abn, "123") } before do Spree::Config[:mails_from] = "spree@example.com" + ActionMailer::Base.perform_deliveries = true end + it "should allow me to send order invoices" do expect do spree_get :invoice, params