diff options
Diffstat (limited to 'actionmailer/test/i18n_with_controller_test.rb')
-rw-r--r-- | actionmailer/test/i18n_with_controller_test.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/actionmailer/test/i18n_with_controller_test.rb b/actionmailer/test/i18n_with_controller_test.rb index 50c4b74eb8..a87a9c9861 100644 --- a/actionmailer/test/i18n_with_controller_test.rb +++ b/actionmailer/test/i18n_with_controller_test.rb @@ -1,10 +1,10 @@ -require 'abstract_unit' -require 'action_view' -require 'action_controller' +require "abstract_unit" +require "action_view" +require "action_controller" class I18nTestMailer < ActionMailer::Base configure do |c| - c.assets_dir = '' + c.assets_dir = "" end def mail_with_i18n_subject(recipient) @@ -18,7 +18,7 @@ end class TestController < ActionController::Base def send_mail email = I18nTestMailer.mail_with_i18n_subject("test@localhost").deliver_now - render text: "Mail sent - Subject: #{email.subject}" + render plain: "Mail sent - Subject: #{email.subject}" end end @@ -26,7 +26,7 @@ class ActionMailerI18nWithControllerTest < ActionDispatch::IntegrationTest Routes = ActionDispatch::Routing::RouteSet.new Routes.draw do ActiveSupport::Deprecation.silence do - get ':controller(/:action(/:id))' + get ":controller(/:action(/:id))" end end @@ -56,9 +56,9 @@ class ActionMailerI18nWithControllerTest < ActionDispatch::IntegrationTest def 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 + with_translation "de", email_subject: "[Anmeldung] Willkommen" do ActiveSupport::Deprecation.silence do - get '/test/send_mail' + get "/test/send_mail" end assert_equal "Mail sent - Subject: [Anmeldung] Willkommen", @response.body end @@ -66,12 +66,12 @@ class ActionMailerI18nWithControllerTest < ActionDispatch::IntegrationTest end end - protected + private - def with_translation(locale, data) - I18n.backend.store_translations(locale, data) - yield - ensure - I18n.backend.reload! - end + def with_translation(locale, data) + I18n.backend.store_translations(locale, data) + yield + ensure + I18n.backend.reload! + end end |