aboutsummaryrefslogtreecommitdiffstats
path: root/railties/generators/mailer/templates
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-10 18:38:02 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-10 18:38:02 +0000
commit5ae593f10b31c5189605ea865b0f9bbfc8a9ef28 (patch)
tree716c96f956c0fc291607b35e16c938b3f9a465a2 /railties/generators/mailer/templates
parent1188d3005a35df9a9ef3fd43b6ab7252b10399aa (diff)
downloadrails-5ae593f10b31c5189605ea865b0f9bbfc8a9ef28.tar.gz
rails-5ae593f10b31c5189605ea865b0f9bbfc8a9ef28.tar.bz2
rails-5ae593f10b31c5189605ea865b0f9bbfc8a9ef28.zip
Mailer generator should create passing tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@111 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/generators/mailer/templates')
-rw-r--r--railties/generators/mailer/templates/fixture.rhtml3
-rw-r--r--railties/generators/mailer/templates/mailer.rb5
-rw-r--r--railties/generators/mailer/templates/unit_test.rb4
3 files changed, 5 insertions, 7 deletions
diff --git a/railties/generators/mailer/templates/fixture.rhtml b/railties/generators/mailer/templates/fixture.rhtml
index f315d430ed..b481906829 100644
--- a/railties/generators/mailer/templates/fixture.rhtml
+++ b/railties/generators/mailer/templates/fixture.rhtml
@@ -1,4 +1,3 @@
<%= class_name %>#<%= action %>
-Find me in test/fixtures/<%= file_name %>/<%= action %>.
-I'm tested against the view in app/views/<%= file_name %>/<%= action %>.
+Find me in app/views/<%= file_name %>/<%= action %>.rhtml
diff --git a/railties/generators/mailer/templates/mailer.rb b/railties/generators/mailer/templates/mailer.rb
index 6621ba9a01..d6e8d1691d 100644
--- a/railties/generators/mailer/templates/mailer.rb
+++ b/railties/generators/mailer/templates/mailer.rb
@@ -4,11 +4,12 @@ class <%= class_name %> < ActionMailer::Base
<% for action in actions -%>
def <%= action %>(sent_on = Time.now)
+ @subject = '<%= class_name %>#<%= action %>'
+ @body = {}
@recipients = ''
@from = ''
- @subject = ''
- @body = {}
@sent_on = sent_on
+ @headers = {}
end
<% end -%>
end
diff --git a/railties/generators/mailer/templates/unit_test.rb b/railties/generators/mailer/templates/unit_test.rb
index 3bf460907f..9b9b436df1 100644
--- a/railties/generators/mailer/templates/unit_test.rb
+++ b/railties/generators/mailer/templates/unit_test.rb
@@ -10,13 +10,11 @@ class <%= class_name %>Test < Test::Unit::TestCase
ActionMailer::Base.deliveries = []
@expected = TMail::Mail.new
- @expected.to = 'test@localhost'
- @expected.from = 'test@localhost'
end
<% for action in actions -%>
def test_<%= action %>
- @expected.subject = '<%= class_name %>#<%= action %> test mail'
+ @expected.subject = '<%= class_name %>#<%= action %>'
@expected.body = read_fixture('<%= action %>')
@expected.date = Time.now