From dc9f6fc046dac3bf26dd37625e977e57a129ba8f Mon Sep 17 00:00:00 2001 From: Brian Cardarella Date: Sat, 23 Jun 2012 15:10:49 -0400 Subject: Force message delivery despite async --- actionmailer/test/base_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionmailer/test') diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index fdc784029b..908ce719b5 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -432,6 +432,14 @@ class BaseTest < ActiveSupport::TestCase assert_equal(1, AsyncMailer.deliveries.length) end + test "forcing message delivery despite asynchronous" do + Rails.stubs(:queue).returns(Rails::Queueing::TestQueue.new) + AsyncMailer.delivery_method = :test + AsyncMailer.deliveries.clear + AsyncMailer.welcome.deliver(true) + assert_equal(1, AsyncMailer.deliveries.length) + end + test "calling deliver, ActionMailer should yield back to mail to let it call :do_delivery on itself" do mail = Mail::Message.new mail.expects(:do_delivery).once -- cgit v1.2.3