Update generators to use new defaults.

This commit is contained in:
José Valim and Mikel Lindsaar
2010-01-26 11:48:25 +01:00
parent 39a1b06f13
commit 8fabcb2eca
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
class <%= class_name %> < ActionMailer::Base
self.defaults = { :from => "from@example.com" }
self.defaults :from => "from@example.com"
<% for action in actions -%>
# Subject can be set in your I18n file at config/locales/en.yml

View File

@@ -9,7 +9,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase
run_generator
assert_file "app/mailers/notifier.rb" do |mailer|
assert_match /class Notifier < ActionMailer::Base/, mailer
assert_match /self\.defaults\ =\ \{\ :from\ =>\ "from@example\.com"\ \}/, mailer
assert_match /self\.defaults :from => "from@example.com"/, mailer
end
end