diff options
author | José Valim <jose.valim@gmail.com> | 2011-10-09 02:15:19 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-10-09 02:15:19 -0700 |
commit | 501e5b0d7ff995070e66d4322ed03bd882639258 (patch) | |
tree | 10341d3a391c1fe62808b34dd7cf49323428bd8f /actionmailer/lib | |
parent | bedd6dcd432f55460624455b5026d1d52c1967d4 (diff) | |
parent | 8df7fe3f630e13da1585c151f6f2f986ea7dcdfd (diff) | |
download | rails-501e5b0d7ff995070e66d4322ed03bd882639258.tar.gz rails-501e5b0d7ff995070e66d4322ed03bd882639258.tar.bz2 rails-501e5b0d7ff995070e66d4322ed03bd882639258.zip |
Merge pull request #3196 from avakhov/patch-am-av-tests-2
Improve tests method for ActionView::TestCase and ActionMailer::TestCase
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/test_case.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/test_case.rb b/actionmailer/lib/action_mailer/test_case.rb index 63e18147f6..c4de029694 100644 --- a/actionmailer/lib/action_mailer/test_case.rb +++ b/actionmailer/lib/action_mailer/test_case.rb @@ -17,7 +17,14 @@ module ActionMailer module ClassMethods def tests(mailer) - self._mailer_class = mailer + case mailer + when String, Symbol + self._mailer_class = mailer.to_s.camelize.constantize + when Module + self._mailer_class = mailer + else + raise NonInferrableMailerError.new(mailer) + end end def mailer_class |