diff options
-rw-r--r-- | railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb | 12 | ||||
-rw-r--r-- | railties/test/generators/rails_mailer_generator_test.rb | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb b/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb index 127495fcbb..3a1724a62e 100644 --- a/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +++ b/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb @@ -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 diff --git a/railties/test/generators/rails_mailer_generator_test.rb b/railties/test/generators/rails_mailer_generator_test.rb index 9b5debbdb1..3cf8cda442 100644 --- a/railties/test/generators/rails_mailer_generator_test.rb +++ b/railties/test/generators/rails_mailer_generator_test.rb @@ -8,12 +8,12 @@ class RailsMailerGeneratorTest < GeneratorTestCase 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 |