aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/test_unit
diff options
context:
space:
mode:
authorJosé Valim and Mikel Lindsaar <pair@programming.com>2010-01-25 13:13:29 +0100
committerJosé Valim and Mikel Lindsaar <pair@programming.com>2010-01-25 13:20:32 +0100
commit9cb3ca1d29eb770c1a7adac3798666847fceee2b (patch)
tree70aeb2f12e00d98c13d7f55bdd9d445d4223fcfd /railties/lib/generators/test_unit
parentad8f5d4106c77ed1d054bf3b29bec94df557a7cd (diff)
downloadrails-9cb3ca1d29eb770c1a7adac3798666847fceee2b.tar.gz
rails-9cb3ca1d29eb770c1a7adac3798666847fceee2b.tar.bz2
rails-9cb3ca1d29eb770c1a7adac3798666847fceee2b.zip
Change mailer generator templates and refactor the whole naming schema.
Diffstat (limited to 'railties/lib/generators/test_unit')
-rw-r--r--railties/lib/generators/test_unit/mailer/templates/fixture2
-rw-r--r--railties/lib/generators/test_unit/mailer/templates/functional_test.rb12
2 files changed, 10 insertions, 4 deletions
diff --git a/railties/lib/generators/test_unit/mailer/templates/fixture b/railties/lib/generators/test_unit/mailer/templates/fixture
index fcce7bd805..171648d6fd 100644
--- a/railties/lib/generators/test_unit/mailer/templates/fixture
+++ b/railties/lib/generators/test_unit/mailer/templates/fixture
@@ -1,3 +1,3 @@
<%= class_name %>#<%= @action %>
-Find me in app/views/<%= @path %>
+Hi, find me in app/views/<%= @path %>
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 d7366fea5f..2f694e431c 100644
--- a/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
+++ b/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
@@ -3,11 +3,17 @@ require 'test_helper'
class <%= class_name %>Test < ActionMailer::TestCase
<% for action in actions -%>
test "<%= action %>" do
- @expected.subject = '<%= class_name %>#<%= action %>'
- @expected.body = read_fixture('<%= action %>')
+ @actual = <%= class_name %>.<%= action %>
+
+ @expected.subject = <%= action.to_s.humanize.inspect %>
+ @expected.body = read_fixture("<%= action %>")
@expected.date = Time.now
- assert_equal @expected, <%= class_name %>.create_<%= action %>(@expected.date)
+ assert_difference "<%= class_name %>.deliveries.size" do
+ @actual.deliver
+ end
+
+ assert_equal @expected.encoded, @actual.encoded
end
<% end -%>