diff options
author | Carlos Souza <carloshrsouza@gmail.com> | 2014-12-17 13:18:22 -0500 |
---|---|---|
committer | Carlos Souza <carloshrsouza@gmail.com> | 2015-01-06 10:46:22 -0500 |
commit | 5697bdbb6da5d08e541a3b12251cec90269b059b (patch) | |
tree | 3a98e7d3bb11826ab8cb7c05e887cd21e46e71ec /railties/lib | |
parent | 52f641264b1325a4c2bdce7971b14524bd4905f1 (diff) | |
download | rails-5697bdbb6da5d08e541a3b12251cec90269b059b.tar.gz rails-5697bdbb6da5d08e541a3b12251cec90269b059b.tar.bz2 rails-5697bdbb6da5d08e541a3b12251cec90269b059b.zip |
Add mailer suffix to generated files and classes
Following the same naming convention used in
controllers and jobs.
Diffstat (limited to 'railties/lib')
3 files changed, 6 insertions, 6 deletions
diff --git a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb index 85dee1a066..ba131da79d 100644 --- a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb @@ -6,15 +6,15 @@ module TestUnit # :nodoc: argument :actions, type: :array, default: [], banner: "method method" def check_class_collision - class_collisions "#{class_name}Test", "#{class_name}Preview" + class_collisions "#{class_name}MailerTest", "#{class_name}MailerPreview" end def create_test_files - template "functional_test.rb", File.join('test/mailers', class_path, "#{file_name}_test.rb") + template "functional_test.rb", File.join('test/mailers', class_path, "#{file_name}_mailer_test.rb") end def create_preview_files - template "preview.rb", File.join('test/mailers/previews', class_path, "#{file_name}_preview.rb") + template "preview.rb", File.join('test/mailers/previews', class_path, "#{file_name}_mailer_preview.rb") end end end diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb index 7e204105a3..3cee517db3 100644 --- a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb @@ -1,7 +1,7 @@ require 'test_helper' <% module_namespacing do -%> -class <%= class_name %>Test < ActionMailer::TestCase +class <%= class_name %>MailerTest < ActionMailer::TestCase <% actions.each do |action| -%> test "<%= action %>" do mail = <%= class_name %>.<%= action %> diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb b/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb index 3bfd5426e8..6b85764a66 100644 --- a/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb +++ b/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb @@ -1,11 +1,11 @@ <% module_namespacing do -%> # Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %> -class <%= class_name %>Preview < ActionMailer::Preview +class <%= class_name %>MailerPreview < ActionMailer::Preview <% actions.each do |action| -%> # Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>/<%= action %> def <%= action %> - <%= class_name %>.<%= action %> + <%= class_name %>Mailer.<%= action %> end <% end -%> |