aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorBrian Cardarella <bcardarella@gmail.com>2012-06-23 15:10:49 -0400
committerBrian Cardarella <bcardarella@gmail.com>2012-06-23 15:12:31 -0400
commitdc9f6fc046dac3bf26dd37625e977e57a129ba8f (patch)
tree0b0ebddee90a369ac80d3c95bdf6c3c521dddbdb /actionmailer/test
parentb6792e91975a3cc9a6a5d5cf49532e90c8d3cc2a (diff)
downloadrails-dc9f6fc046dac3bf26dd37625e977e57a129ba8f.tar.gz
rails-dc9f6fc046dac3bf26dd37625e977e57a129ba8f.tar.bz2
rails-dc9f6fc046dac3bf26dd37625e977e57a129ba8f.zip
Force message delivery despite async
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/base_test.rb8
1 files changed, 8 insertions, 0 deletions
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