diff options
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/base_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index 81e41dc8d4..5506d62d6a 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -116,11 +116,19 @@ class BaseTest < ActiveSupport::TestCase class ProcMailer < ActionMailer::Base default :to => 'system@test.lindsaar.net', - 'X-Proc-Method' => Proc.new { Time.now.to_i.to_s } + 'X-Proc-Method' => Proc.new { Time.now.to_i.to_s }, + :subject => Proc.new { give_a_greeting } def welcome mail end + + private + + def give_a_greeting + "Thanks for signing up this afternoon" + end + end test "method call to mail does not raise error" do @@ -577,6 +585,11 @@ class BaseTest < ActiveSupport::TestCase mail2 = ProcMailer.welcome assert(mail1['X-Proc-Method'].to_s.to_i > mail2['X-Proc-Method'].to_s.to_i) end + + test "we can call other defined methods on the class as needed" do + mail = ProcMailer.welcome + assert_equal("Thanks for signing up this afternoon", mail.subject) + end protected |