diff options
Diffstat (limited to 'actionmailer/test/mailers')
-rw-r--r-- | actionmailer/test/mailers/caching_mailer.rb | 8 | ||||
-rw-r--r-- | actionmailer/test/mailers/delayed_mailer.rb | 20 |
2 files changed, 28 insertions, 0 deletions
diff --git a/actionmailer/test/mailers/caching_mailer.rb b/actionmailer/test/mailers/caching_mailer.rb index 345d267a36..92d3cff7c9 100644 --- a/actionmailer/test/mailers/caching_mailer.rb +++ b/actionmailer/test/mailers/caching_mailer.rb @@ -12,4 +12,12 @@ class CachingMailer < ActionMailer::Base def skip_fragment_cache_digesting mail(subject: "welcome", template_name: "skip_fragment_cache_digesting") end + + def fragment_caching_options + mail(subject: "welcome", template_name: "fragment_caching_options") + end + + def multipart_cache + mail(subject: "welcome", template_name: "multipart_cache") + end end diff --git a/actionmailer/test/mailers/delayed_mailer.rb b/actionmailer/test/mailers/delayed_mailer.rb index 62d4baa434..e6211ef028 100644 --- a/actionmailer/test/mailers/delayed_mailer.rb +++ b/actionmailer/test/mailers/delayed_mailer.rb @@ -1,6 +1,26 @@ +require 'active_job/arguments' + +class DelayedMailerError < StandardError; end + class DelayedMailer < ActionMailer::Base + cattr_accessor :last_error + cattr_accessor :last_rescue_from_instance + + rescue_from DelayedMailerError do |error| + @@last_error = error + @@last_rescue_from_instance = self + end + + rescue_from ActiveJob::DeserializationError do |error| + @@last_error = error + @@last_rescue_from_instance = self + end def test_message(*) mail(from: 'test-sender@test.com', to: 'test-receiver@test.com', subject: 'Test Subject', body: 'Test Body') end + + def test_raise(klass_name) + raise klass_name.constantize, 'boom' + end end |