diff options
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/base_test.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index 0b650e9a28..7f41f3485c 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -327,7 +327,21 @@ class BaseTest < ActiveSupport::TestCase test "ActionMailer should be told when Mail gets delivered" do BaseMailer.deliveries.clear BaseMailer.expects(:delivered_email).once - email = BaseMailer.deliver_welcome + BaseMailer.deliver_welcome + assert_equal(1, BaseMailer.deliveries.length) + end + + test "Calling just the action should return the generated mail object" do + BaseMailer.deliveries.clear + email = BaseMailer.welcome + assert_equal(0, BaseMailer.deliveries.length) + assert_equal('The first email on new API!', email.subject) + end + + test "Calling deliver on the action should deliver the mail object" do + BaseMailer.deliveries.clear + BaseMailer.expects(:delivered_email).once + BaseMailer.welcome.deliver assert_equal(1, BaseMailer.deliveries.length) end |