aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-09-10 12:52:19 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2012-09-11 15:11:52 -0700
commit34b23e7110a3a13cf157608cefc9b5701017bf39 (patch)
tree1b4f9962bddde61a8f7239b8a49b06e4c04f3429 /actionmailer/test
parentb4b5971ff73f3191be03644fa0c9951a930717d2 (diff)
downloadrails-34b23e7110a3a13cf157608cefc9b5701017bf39.tar.gz
rails-34b23e7110a3a13cf157608cefc9b5701017bf39.tar.bz2
rails-34b23e7110a3a13cf157608cefc9b5701017bf39.zip
Action Mailer async flag is true by default using a Synchronous impl
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/abstract_unit.rb9
-rw-r--r--actionmailer/test/base_test.rb6
-rw-r--r--actionmailer/test/mailers/async_mailer.rb1
3 files changed, 12 insertions, 4 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index 99c44179fd..e5f9bae897 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -11,6 +11,7 @@ end
require 'minitest/autorun'
require 'action_mailer'
require 'action_mailer/test_case'
+require 'rails/queueing'
silence_warnings do
# These external dependencies have warnings :/
@@ -27,6 +28,14 @@ ActionView::Template.register_template_handler :bak, lambda { |template| "Lame b
FIXTURE_LOAD_PATH = File.expand_path('fixtures', File.dirname(__FILE__))
ActionMailer::Base.view_paths = FIXTURE_LOAD_PATH
+class ActionMailer::Base < AbstractController::Base
+ class << self
+ def queue
+ @queue ||= Rails::Queueing::Container.new(Rails::Queueing::SynchronousQueue.new)
+ end
+ end
+end
+
class MockSMTP
def self.deliveries
@@deliveries
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index c7b8f47d89..862b954f9e 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -575,11 +575,11 @@ class BaseTest < ActiveSupport::TestCase
end
test "being able to put proc's into the defaults hash and they get evaluated on mail sending" do
- mail1 = ProcMailer.welcome
+ mail1 = ProcMailer.welcome['X-Proc-Method']
yesterday = 1.day.ago
Time.stubs(:now).returns(yesterday)
- mail2 = ProcMailer.welcome
- assert(mail1['X-Proc-Method'].to_s.to_i > mail2['X-Proc-Method'].to_s.to_i)
+ mail2 = ProcMailer.welcome['X-Proc-Method']
+ assert(mail1.to_s.to_i > mail2.to_s.to_i)
end
test "we can call other defined methods on the class as needed" do
diff --git a/actionmailer/test/mailers/async_mailer.rb b/actionmailer/test/mailers/async_mailer.rb
index ce601e7343..8a87e2e1cf 100644
--- a/actionmailer/test/mailers/async_mailer.rb
+++ b/actionmailer/test/mailers/async_mailer.rb
@@ -1,3 +1,2 @@
class AsyncMailer < BaseMailer
- self.async = true
end