From c2e7851fb20d24f49b55b5276cc3056082721dc4 Mon Sep 17 00:00:00 2001 From: Jose' Valim Date: Sun, 11 Jan 2009 11:02:54 +0100 Subject: Add ActionMailer::Base#enable_starttls_auto option for enabling/disabling STARTTLS. [#1731 state:resolved] Signed-off-by: Pratik Naik --- actionmailer/test/mail_service_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionmailer/test/mail_service_test.rb') 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 -- cgit v1.2.3