Changed mailer generator to not use instance variables.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
This commit is contained in:
parent
dfdb9f738e
commit
36eecda8d0
@ -2,12 +2,12 @@ class <%= class_name %> < ActionMailer::Base
|
||||
<% for action in actions -%>
|
||||
|
||||
def <%= action %>(sent_at = Time.now)
|
||||
@subject = '<%= class_name %>#<%= action %>'
|
||||
@body = {}
|
||||
@recipients = ''
|
||||
@from = ''
|
||||
@sent_on = sent_at
|
||||
@headers = {}
|
||||
subject '<%= class_name %>#<%= action %>'
|
||||
recipients ''
|
||||
from ''
|
||||
sent_on sent_at
|
||||
|
||||
body :action => '<%= action %>'
|
||||
end
|
||||
<% end -%>
|
||||
end
|
||||
|
@ -8,12 +8,12 @@ def test_generates_mailer
|
||||
assert_generated_model_for :notifier, 'ActionMailer::Base' do |model|
|
||||
assert_has_method model, :reset_password do |name, body|
|
||||
assert_equal [
|
||||
"@subject = 'Notifier#reset_password'",
|
||||
"@body = {}",
|
||||
"@recipients = ''",
|
||||
"@from = ''",
|
||||
"@sent_on = sent_at",
|
||||
"@headers = {}"
|
||||
"subject 'Notifier#reset_password'",
|
||||
"recipients ''",
|
||||
"from ''",
|
||||
"sent_on sent_at",
|
||||
"",
|
||||
"body :action => 'reset_password'"
|
||||
],
|
||||
body.split("\n").map{|line| line.sub(' '*4, '') }
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user