diff options
Diffstat (limited to 'actionmailer/test/i18n_with_controller_test.rb')
-rw-r--r-- | actionmailer/test/i18n_with_controller_test.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/actionmailer/test/i18n_with_controller_test.rb b/actionmailer/test/i18n_with_controller_test.rb index 5ffde06a80..04e00cf481 100644 --- a/actionmailer/test/i18n_with_controller_test.rb +++ b/actionmailer/test/i18n_with_controller_test.rb @@ -53,12 +53,15 @@ class ActionMailerI18nWithControllerTest < ActionDispatch::IntegrationTest end def test_send_mail - Mail::SMTP.any_instance.expects(:deliver!) - with_translation 'de', email_subject: '[Anmeldung] Willkommen' do - ActiveSupport::Deprecation.silence do - get '/test/send_mail' + stub_any_instance(Mail::SMTP, instance: Mail::SMTP.new({})) do |instance| + assert_called(instance, :deliver!) do + with_translation 'de', email_subject: '[Anmeldung] Willkommen' do + ActiveSupport::Deprecation.silence do + get '/test/send_mail' + end + assert_equal "Mail sent - Subject: [Anmeldung] Willkommen", @response.body + end end - assert_equal "Mail sent - Subject: [Anmeldung] Willkommen", @response.body end end |