diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-01-03 00:40:28 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-01-03 00:40:28 +0000 |
commit | 6a6367d7d207e54fced36b58a1abdd7ef0d36f82 (patch) | |
tree | e7231c6588fff012bd3e1f8a3c13db1264a7f6e1 /actionmailer/lib | |
parent | 64b4c18e159a1a75f70b64c5be780eb5cfe92aa9 (diff) | |
download | rails-6a6367d7d207e54fced36b58a1abdd7ef0d36f82.tar.gz rails-6a6367d7d207e54fced36b58a1abdd7ef0d36f82.tar.bz2 rails-6a6367d7d207e54fced36b58a1abdd7ef0d36f82.zip |
Fixed that you don't have to call super in ActionMailer::TestCase#setup (closes #10406) [jamesgolick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8536 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/test_case.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/test_case.rb b/actionmailer/lib/action_mailer/test_case.rb index cc75b39280..7829baa799 100644 --- a/actionmailer/lib/action_mailer/test_case.rb +++ b/actionmailer/lib/action_mailer/test_case.rb @@ -33,7 +33,7 @@ module ActionMailer end end - def setup + def setup_with_mailer ActionMailer::Base.delivery_method = :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @@ -42,6 +42,19 @@ module ActionMailer @expected.set_content_type "text", "plain", { "charset" => charset } @expected.mime_version = '1.0' end + alias_method :setup, :setup_with_mailer + + def self.method_added(method) + if method.to_s == 'setup' + unless method_defined?(:setup_without_mailer) + alias_method :setup_without_mailer, :setup + define_method(:setup) do + setup_with_mailer + setup_without_mailer + end + end + end + end private def charset |