diff options
author | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-26 01:06:48 +0100 |
---|---|---|
committer | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-26 01:09:08 +0100 |
commit | 1b3cb54ebae685d4db9eefc99ce68b36d5641751 (patch) | |
tree | 5f8eed9c31a9cdeeb8982ecaab9463259eecd3be /railties/lib | |
parent | f14390091c40149dcd0982ada097be5bcbb37003 (diff) | |
download | rails-1b3cb54ebae685d4db9eefc99ce68b36d5641751.tar.gz rails-1b3cb54ebae685d4db9eefc99ce68b36d5641751.tar.bz2 rails-1b3cb54ebae685d4db9eefc99ce68b36d5641751.zip |
More work on generated mailer templates.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/generators/erb/mailer/mailer_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/generators/erb/mailer/templates/view.text.erb (renamed from railties/lib/generators/erb/mailer/templates/view.erb) | 0 | ||||
-rw-r--r-- | railties/lib/generators/rails/mailer/templates/mailer.rb | 4 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/mailer/templates/functional_test.rb | 10 |
4 files changed, 6 insertions, 10 deletions
diff --git a/railties/lib/generators/erb/mailer/mailer_generator.rb b/railties/lib/generators/erb/mailer/mailer_generator.rb index 4ec2f4c9f4..408c942cef 100644 --- a/railties/lib/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/generators/erb/mailer/mailer_generator.rb @@ -12,7 +12,7 @@ module Erb def create_view_files actions.each do |action| @action, @path = action, File.join(file_path, action) - template "view.erb", File.join("app/views", "#{@path}.erb") + template "view.text.erb", File.join("app/views", "#{@path}.text.erb") end end end diff --git a/railties/lib/generators/erb/mailer/templates/view.erb b/railties/lib/generators/erb/mailer/templates/view.text.erb index 6d597256a6..6d597256a6 100644 --- a/railties/lib/generators/erb/mailer/templates/view.erb +++ b/railties/lib/generators/erb/mailer/templates/view.text.erb diff --git a/railties/lib/generators/rails/mailer/templates/mailer.rb b/railties/lib/generators/rails/mailer/templates/mailer.rb index 5e7ef42370..1685b73633 100644 --- a/railties/lib/generators/rails/mailer/templates/mailer.rb +++ b/railties/lib/generators/rails/mailer/templates/mailer.rb @@ -1,5 +1,5 @@ class <%= class_name %> < ActionMailer::Base - delivers_from "mail@<%= application_name %>.com" + delivers_from "from@example.com" <% for action in actions -%> # Subject can be set in your I18n file at config/locales/en.yml @@ -9,7 +9,7 @@ class <%= class_name %> < ActionMailer::Base # def <%= action %> @greeting = "Hi" - mail(:to => "") + mail(:to => "to@example.com") end <% end -%> end
\ No newline at end of file diff --git a/railties/lib/generators/test_unit/mailer/templates/functional_test.rb b/railties/lib/generators/test_unit/mailer/templates/functional_test.rb index 2f694e431c..fcebb40135 100644 --- a/railties/lib/generators/test_unit/mailer/templates/functional_test.rb +++ b/railties/lib/generators/test_unit/mailer/templates/functional_test.rb @@ -3,17 +3,13 @@ require 'test_helper' class <%= class_name %>Test < ActionMailer::TestCase <% for action in actions -%> test "<%= action %>" do - @actual = <%= class_name %>.<%= action %> - @expected.subject = <%= action.to_s.humanize.inspect %> + @expected.to = "to@example.com" + @expected.from = "from@example.com" @expected.body = read_fixture("<%= action %>") @expected.date = Time.now - assert_difference "<%= class_name %>.deliveries.size" do - @actual.deliver - end - - assert_equal @expected.encoded, @actual.encoded + assert_equal @expected, <%= class_name %>.<%= action %> end <% end -%> |