aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/abstract_unit.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-11-07 16:05:17 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-11-07 16:05:17 +0000
commit57cde631383a8a0fa8d231ac1ae85ea725e12cd5 (patch)
tree085048b9a8aa2456b4842cf45af66bde320615b8 /actionmailer/test/abstract_unit.rb
parent6b018e3d08c52417034cd648952668192327a9b7 (diff)
downloadrails-57cde631383a8a0fa8d231ac1ae85ea725e12cd5.tar.gz
rails-57cde631383a8a0fa8d231ac1ae85ea725e12cd5.tar.bz2
rails-57cde631383a8a0fa8d231ac1ae85ea725e12cd5.zip
Allow ActionMailer subclasses to individually set their delivery method (so two subclasses can have different delivery methods) (closes #10033) [zdennis]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8111 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test/abstract_unit.rb')
-rw-r--r--actionmailer/test/abstract_unit.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index 0a73b1b462..9b7a4661b6 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -38,3 +38,12 @@ def uses_mocha(test_name)
rescue Gem::LoadError
$stderr.puts "Skipping #{test_name} tests (Mocha >= 0.5 is required). `gem install mocha` and try again."
end
+
+def set_delivery_method(delivery_method)
+ @old_delivery_method = ActionMailer::Base.delivery_method
+ ActionMailer::Base.delivery_method = delivery_method
+end
+
+def restore_delivery_method
+ ActionMailer::Base.delivery_method = @old_delivery_method
+end