Skip to content

Commit

Permalink
Merge pull request #18416 from caike/master
Browse files Browse the repository at this point in the history
Add _mailer suffix to i18n path
  • Loading branch information
rafaelfranca committed Jan 9, 2015
2 parents 924ef1c + 6870d48 commit 6f9eab9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions railties/test/generators/mailer_generator_test.rb
Expand Up @@ -26,8 +26,8 @@ def test_application_mailer_skeleton_is_created
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

Expand Down Expand Up @@ -126,7 +126,7 @@ def test_mailer_with_namedspaced_mailer
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)
Expand Down
4 changes: 2 additions & 2 deletions railties/test/generators/namespaced_generators_test.rb
Expand Up @@ -156,8 +156,8 @@ def test_mailer_skeleton_is_created
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

Expand Down

0 comments on commit 6f9eab9

Please sign in to comment.