diff options
author | Alexey Vakhov <vakhov@gmail.com> | 2011-10-03 11:04:22 +0400 |
---|---|---|
committer | Alexey Vakhov <vakhov@gmail.com> | 2011-10-03 14:27:41 +0400 |
commit | 0defbc6bfeff053983ef65739b2dcc080b2ad227 (patch) | |
tree | 524898771091444875b29f01402b1c0ce1c55c83 /actionmailer/lib | |
parent | 6f429f375e43529f2dd1a2f37cbaabeef40c6ea9 (diff) | |
download | rails-0defbc6bfeff053983ef65739b2dcc080b2ad227.tar.gz rails-0defbc6bfeff053983ef65739b2dcc080b2ad227.tar.bz2 rails-0defbc6bfeff053983ef65739b2dcc080b2ad227.zip |
normalize arg for ActionMailer::TestCase tests method
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 |