From 45537f00b4b412d4dc6f9ae746aa24346e6b705a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Sep 2012 14:23:07 -0300 Subject: Allow users to configure the queue for the mailers This allow the users to do: config.action_mailer.queue = MyQueue.new and class UsersMailer < ActionMailer::Base self.queue = MyQueue.new end --- .../test/application/initializers/frameworks_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'railties/test/application') diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index fbce97e1a9..1eb5fce384 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -50,6 +50,23 @@ module ApplicationTests assert_equal "test.rails", ActionMailer::Base.default_url_options[:host] end + test "uses the default queue for ActionMailer" do + require "#{app_path}/config/environment" + assert_kind_of Rails::Queueing::Container, ActionMailer::Base.queue + end + + test "allows me to configure queue for ActionMailer" do + app_file "config/environments/development.rb", <<-RUBY + AppTemplate::Application.configure do + Rails.queue[:mailer] = Rails::Queueing::TestQueue.new + config.action_mailer.queue = Rails.queue[:mailer] + end + RUBY + + require "#{app_path}/config/environment" + assert_kind_of Rails::Queueing::TestQueue, ActionMailer::Base.queue + end + test "does not include url helpers as action methods" do app_file "config/routes.rb", <<-RUBY AppTemplate::Application.routes.draw do -- cgit v1.2.3