diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-12 14:23:07 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-12 15:32:22 -0300 |
commit | 45537f00b4b412d4dc6f9ae746aa24346e6b705a (patch) | |
tree | 7d1fea890d11a8ef0c123e34a053d3d9bbb0b010 /railties/test/application/initializers | |
parent | 9bb4850e7bf864e0277140ab6d3d4ae67ef68170 (diff) | |
download | rails-45537f00b4b412d4dc6f9ae746aa24346e6b705a.tar.gz rails-45537f00b4b412d4dc6f9ae746aa24346e6b705a.tar.bz2 rails-45537f00b4b412d4dc6f9ae746aa24346e6b705a.zip |
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
Diffstat (limited to 'railties/test/application/initializers')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 |