mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add _mailer suffix to i18n path
For mailers created via generators Follow up to #18074
This commit is contained in:
parent
a74041d483
commit
6870d48d19
3 changed files with 6 additions and 6 deletions
|
@ -5,7 +5,7 @@ class <%= class_name %>Mailer < ApplicationMailer
|
|||
# Subject can be set in your I18n file at config/locales/en.yml
|
||||
# with the following lookup:
|
||||
#
|
||||
# en.<%= file_path.tr("/",".") %>.<%= action %>.subject
|
||||
# en.<%= file_path.tr("/",".") %>_mailer.<%= action %>.subject
|
||||
#
|
||||
def <%= action %>
|
||||
@greeting = "Hi"
|
||||
|
|
|
@ -26,8 +26,8 @@ class MailerGeneratorTest < Rails::Generators::TestCase
|
|||
def test_mailer_with_i18n_helper
|
||||
run_generator
|
||||
assert_file "app/mailers/notifier_mailer.rb" do |mailer|
|
||||
assert_match(/en\.notifier\.foo\.subject/, mailer)
|
||||
assert_match(/en\.notifier\.bar\.subject/, mailer)
|
||||
assert_match(/en\.notifier_mailer\.foo\.subject/, mailer)
|
||||
assert_match(/en\.notifier_mailer\.bar\.subject/, mailer)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -126,7 +126,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase
|
|||
run_generator ["Farm::Animal", "moos"]
|
||||
assert_file "app/mailers/farm/animal_mailer.rb" do |mailer|
|
||||
assert_match(/class Farm::AnimalMailer < ApplicationMailer/, mailer)
|
||||
assert_match(/en\.farm\.animal\.moos\.subject/, mailer)
|
||||
assert_match(/en\.farm\.animal_mailer\.moos\.subject/, mailer)
|
||||
end
|
||||
assert_file "test/mailers/previews/farm/animal_mailer_preview.rb" do |preview|
|
||||
assert_match(/\# Preview all emails at http:\/\/localhost\:3000\/rails\/mailers\/farm\/animal/, preview)
|
||||
|
|
|
@ -156,8 +156,8 @@ class NamespacedMailerGeneratorTest < NamespacedGeneratorTestCase
|
|||
def test_mailer_with_i18n_helper
|
||||
run_generator
|
||||
assert_file "app/mailers/test_app/notifier_mailer.rb" do |mailer|
|
||||
assert_match(/en\.notifier\.foo\.subject/, mailer)
|
||||
assert_match(/en\.notifier\.bar\.subject/, mailer)
|
||||
assert_match(/en\.notifier_mailer\.foo\.subject/, mailer)
|
||||
assert_match(/en\.notifier_mailer\.bar\.subject/, mailer)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue