1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionmailer/test
Jeremy Daer e35b98e6f5
Action Mailer: Declarative exception handling with rescue_from.
Follows the same pattern as controllers and jobs. Exceptions raised in
delivery jobs (enqueued by `#deliver_later`) are also delegated to the
mailer's rescue_from handlers, so you can handle the DeserializationError
raised by delivery jobs:

```ruby
class MyMailer < ApplicationMailer
  rescue_from ActiveJob::DeserializationError do
    …
  end
```

ActiveSupport::Rescuable polish:
* Add the `rescue_with_handler` class method so exceptions may be
  handled at the class level without requiring an instance.
* Rationalize `exception.cause` handling. If no handler matches the
  exception, fall back to the handler that matches its cause.
* Handle exceptions raised elsewhere. Pass `object: …` to execute
  the `rescue_from` handler (e.g. a method call or a block to
  instance_exec) against a different object. Defaults to `self`.
2016-05-15 18:44:16 -07:00
..
fixtures Expand on Action Mailer Fragment caching tests 2016-04-17 23:16:09 +05:30
mailers Action Mailer: Declarative exception handling with rescue_from. 2016-05-15 18:44:16 -07:00
abstract_unit.rb Remove load_paths file 2016-02-27 13:03:57 -05:00
assert_select_email_test.rb
asset_host_test.rb fix tests on action_mailer 2014-10-07 17:40:59 -05:00
base_test.rb Revert "Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptor" 2015-11-23 15:01:24 -07:00
caching_test.rb Expand on Action Mailer Fragment caching tests 2016-04-17 23:16:09 +05:30
delivery_methods_test.rb Sendmail default arguments match Mail::SendMail 2016-04-05 14:11:37 -05:00
i18n_with_controller_test.rb Suppress warnings 2016-03-31 01:07:43 +09:00
log_subscriber_test.rb
mail_helper_test.rb Make ActionMailer #cache helper a no-op, not an exception 2015-04-28 13:56:42 -06:00
mail_layout_test.rb
message_delivery_test.rb Action Mailer: Declarative exception handling with rescue_from. 2016-05-15 18:44:16 -07:00
test_case_test.rb Clear ActionMailer deliveries on setup and teardown 2016-04-25 22:41:18 -05:00
test_helper_test.rb assert_emails in block form use the given number as expected value 2015-05-09 18:59:59 +09:00
url_test.rb Suppress warnings 2016-03-31 01:07:43 +09:00