diff options
author | Mike Moore <mike@blowmage.com> | 2012-09-24 14:46:58 -0600 |
---|---|---|
committer | Mike Moore <mike@blowmage.com> | 2012-09-24 14:46:58 -0600 |
commit | 58434e05fe828a89ac11dd4aa051bd1d5d1cfb09 (patch) | |
tree | 460803a9a9652fea532ee8eb45487d69aed53cc2 /actionmailer/lib | |
parent | 0ce383db58b4718147433ca0e06d7e88efd6c184 (diff) | |
download | rails-58434e05fe828a89ac11dd4aa051bd1d5d1cfb09.tar.gz rails-58434e05fe828a89ac11dd4aa051bd1d5d1cfb09.tar.bz2 rails-58434e05fe828a89ac11dd4aa051bd1d5d1cfb09.zip |
Support mailer tests using spec DSL
Improve how mailer tests to resolve mailers from the test name.
Add tests for mailer tests using the minitest spec DSL.
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/test_case.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionmailer/lib/action_mailer/test_case.rb b/actionmailer/lib/action_mailer/test_case.rb index 251705ae50..e60dda9694 100644 --- a/actionmailer/lib/action_mailer/test_case.rb +++ b/actionmailer/lib/action_mailer/test_case.rb @@ -49,9 +49,11 @@ module ActionMailer end def determine_default_mailer(name) - name.sub(/Test$/, '').constantize - rescue NameError - raise NonInferrableMailerError.new(name) + mailer = determine_constant_from_test_name(name) do |constant| + Class === constant && constant < ActionMailer::Base + end + raise NonInferrableMailerError.new(name) if mailer.nil? + mailer end end |