diff options
Diffstat (limited to 'actionmailer/test/mail_service_test.rb')
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 7f9540c44b..f5cb372b2a 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -938,6 +938,20 @@ EOF mail = TestMailer.create_body_ivar(@recipient) assert_equal "body: foo\nbar: baz", mail.body end + + def test_starttls_is_enabled_if_supported + MockSMTP.any_instance.expects(:respond_to?).with(:enable_starttls_auto).returns(true) + MockSMTP.any_instance.expects(:enable_starttls_auto) + ActionMailer::Base.delivery_method = :smtp + TestMailer.deliver_signed_up(@recipient) + end + + def test_starttls_is_disabled_if_not_supported + 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 end end # uses_mocha |