diff options
author | Jose' Valim <jose.valim@gmail.com> | 2009-01-11 11:02:54 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-01-18 04:19:18 +0000 |
commit | c2e7851fb20d24f49b55b5276cc3056082721dc4 (patch) | |
tree | 1a758d48341b243066a497aaf3afb68c4f06ed3a /actionmailer/test | |
parent | ff0a2678c4bce9da348e1263915558795e3a3640 (diff) | |
download | rails-c2e7851fb20d24f49b55b5276cc3056082721dc4.tar.gz rails-c2e7851fb20d24f49b55b5276cc3056082721dc4.tar.bz2 rails-c2e7851fb20d24f49b55b5276cc3056082721dc4.zip |
Add ActionMailer::Base#enable_starttls_auto option for enabling/disabling STARTTLS. [#1731 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 15a40552c9..a886b1143e 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -948,6 +948,7 @@ EOF end def test_starttls_is_enabled_if_supported + ActionMailer::Base.smtp_settings[:enable_starttls_auto] = true MockSMTP.any_instance.expects(:respond_to?).with(:enable_starttls_auto).returns(true) MockSMTP.any_instance.expects(:enable_starttls_auto) ActionMailer::Base.delivery_method = :smtp @@ -955,11 +956,22 @@ EOF end def test_starttls_is_disabled_if_not_supported + ActionMailer::Base.smtp_settings[:enable_starttls_auto] = true MockSMTP.any_instance.expects(:respond_to?).with(:enable_starttls_auto).returns(false) MockSMTP.any_instance.expects(:enable_starttls_auto).never ActionMailer::Base.delivery_method = :smtp TestMailer.deliver_signed_up(@recipient) end + + def test_starttls_is_not_enabled + ActionMailer::Base.smtp_settings[:enable_starttls_auto] = false + MockSMTP.any_instance.expects(:respond_to?).never + MockSMTP.any_instance.expects(:enable_starttls_auto).never + ActionMailer::Base.delivery_method = :smtp + TestMailer.deliver_signed_up(@recipient) + ensure + ActionMailer::Base.smtp_settings[:enable_starttls_auto] = true + end end end # uses_mocha |