From e0fa2ce9614d4bc28ddc484d5b4fe2f54b402e8a Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sun, 17 Sep 2017 09:29:30 +0900 Subject: Remove frozen_string_literal magic comment from templates Follow up of #30348 --- .../lib/rails/generators/test_unit/mailer/templates/functional_test.rb | 2 -- railties/lib/rails/generators/test_unit/mailer/templates/preview.rb | 2 -- 2 files changed, 4 deletions(-) (limited to 'railties/lib/rails/generators/test_unit/mailer/templates') 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 1ec3a2f360..a2f2d30de5 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,5 +1,3 @@ -# frozen_string_literal: true - require 'test_helper' <% module_namespacing do -%> 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 9876210b6c..b063cbc47b 100644 --- a/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb +++ b/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - <% module_namespacing do -%> # Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>_mailer class <%= class_name %>MailerPreview < ActionMailer::Preview -- cgit v1.2.3 From 8dd76a7a6ff1bb7105beabb8f834ca54ab1e5fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 13 Nov 2017 15:23:28 -0500 Subject: Use .tt extension to all the template files Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878. --- .../test_unit/mailer/templates/functional_test.rb | 21 --------------------- .../mailer/templates/functional_test.rb.tt | 21 +++++++++++++++++++++ .../test_unit/mailer/templates/preview.rb | 13 ------------- .../test_unit/mailer/templates/preview.rb.tt | 13 +++++++++++++ 4 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb create mode 100644 railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt delete mode 100644 railties/lib/rails/generators/test_unit/mailer/templates/preview.rb create mode 100644 railties/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt (limited to 'railties/lib/rails/generators/test_unit/mailer/templates') 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 deleted file mode 100644 index a2f2d30de5..0000000000 --- a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'test_helper' - -<% module_namespacing do -%> -class <%= class_name %>MailerTest < ActionMailer::TestCase -<% actions.each do |action| -%> - test "<%= action %>" do - mail = <%= class_name %>Mailer.<%= action %> - assert_equal <%= action.to_s.humanize.inspect %>, mail.subject - assert_equal ["to@example.org"], mail.to - assert_equal ["from@example.com"], mail.from - assert_match "Hi", mail.body.encoded - end - -<% end -%> -<% if actions.blank? -%> - # test "the truth" do - # assert true - # end -<% end -%> -end -<% end -%> diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt new file mode 100644 index 0000000000..a2f2d30de5 --- /dev/null +++ b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt @@ -0,0 +1,21 @@ +require 'test_helper' + +<% module_namespacing do -%> +class <%= class_name %>MailerTest < ActionMailer::TestCase +<% actions.each do |action| -%> + test "<%= action %>" do + mail = <%= class_name %>Mailer.<%= action %> + assert_equal <%= action.to_s.humanize.inspect %>, mail.subject + assert_equal ["to@example.org"], mail.to + assert_equal ["from@example.com"], mail.from + assert_match "Hi", mail.body.encoded + end + +<% end -%> +<% if actions.blank? -%> + # test "the truth" do + # assert true + # end +<% end -%> +end +<% end -%> diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb b/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb deleted file mode 100644 index b063cbc47b..0000000000 --- a/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb +++ /dev/null @@ -1,13 +0,0 @@ -<% module_namespacing do -%> -# Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>_mailer -class <%= class_name %>MailerPreview < ActionMailer::Preview -<% actions.each do |action| -%> - - # Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>_mailer/<%= action %> - def <%= action %> - <%= class_name %>Mailer.<%= action %> - end -<% end -%> - -end -<% end -%> diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt b/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt new file mode 100644 index 0000000000..b063cbc47b --- /dev/null +++ b/railties/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt @@ -0,0 +1,13 @@ +<% module_namespacing do -%> +# Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>_mailer +class <%= class_name %>MailerPreview < ActionMailer::Preview +<% actions.each do |action| -%> + + # Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>_mailer/<%= action %> + def <%= action %> + <%= class_name %>Mailer.<%= action %> + end +<% end -%> + +end +<% end -%> -- cgit v1.2.3