Fix mailer templates to be rubocop compliant
- spaces around array elements - only emit blank lines between new blocks of code
This commit is contained in:
parent
5bec50bc70
commit
0350187882
@ -1,7 +1,9 @@
|
||||
<% module_namespacing do -%>
|
||||
class <%= class_name %>Mailer < ApplicationMailer
|
||||
<% actions.each do |action| -%>
|
||||
<% actions.each_with_index do |action, index| -%>
|
||||
<% if index != 0 -%>
|
||||
|
||||
<% end -%>
|
||||
# Subject can be set in your I18n file at config/locales/en.yml
|
||||
# with the following lookup:
|
||||
#
|
||||
|
@ -2,7 +2,10 @@ require "test_helper"
|
||||
|
||||
<% module_namespacing do -%>
|
||||
class <%= class_name %>MailerTest < ActionMailer::TestCase
|
||||
<% actions.each do |action| -%>
|
||||
<% actions.each_with_index do |action, index| -%>
|
||||
<% if index != 0 -%>
|
||||
|
||||
<% end -%>
|
||||
test "<%= action %>" do
|
||||
mail = <%= class_name %>Mailer.<%= action %>
|
||||
assert_equal <%= action.to_s.humanize.inspect %>, mail.subject
|
||||
@ -10,7 +13,6 @@ class <%= class_name %>MailerTest < ActionMailer::TestCase
|
||||
assert_equal [ "from@example.com" ], mail.from
|
||||
assert_match "Hi", mail.body.encoded
|
||||
end
|
||||
|
||||
<% end -%>
|
||||
<% if actions.blank? -%>
|
||||
# test "the truth" do
|
||||
|
@ -1,13 +1,14 @@
|
||||
<% 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| -%>
|
||||
<% actions.each_with_index do |action, index| -%>
|
||||
<% if index != 0 -%>
|
||||
|
||||
<% end -%>
|
||||
# Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>_mailer/<%= action %>
|
||||
def <%= action %>
|
||||
<%= class_name %>Mailer.<%= action %>
|
||||
end
|
||||
<% end -%>
|
||||
|
||||
end
|
||||
<% end -%>
|
||||
|
Loading…
Reference in New Issue
Block a user