diff options
author | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 20:38:53 +1100 |
---|---|---|
committer | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 20:38:53 +1100 |
commit | 73a9000402b5766e660dbf3489f5289c21c3f472 (patch) | |
tree | fcbbb7b0161ae9299c67bcbbdcd2d51900678a73 /actionmailer/test | |
parent | afc758297c553de467b0c434330cb703d62795f1 (diff) | |
download | rails-73a9000402b5766e660dbf3489f5289c21c3f472.tar.gz rails-73a9000402b5766e660dbf3489f5289c21c3f472.tar.bz2 rails-73a9000402b5766e660dbf3489f5289c21c3f472.zip |
Adding failing tests for calling just the action, instead of :create_action_name and :deliver_action_name
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 |