2022-06-07 10:58:04 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 22:27:38 -04:00
|
|
|
RSpec.describe FreedomPatches::MailDisableStarttls do
|
2022-06-07 10:58:04 -04:00
|
|
|
subject(:smtp_session) { smtp.build_smtp_session }
|
|
|
|
|
|
|
|
let(:smtp) { Mail::SMTP.new(options) }
|
|
|
|
|
|
|
|
context "when the starttls option is not provided" do
|
|
|
|
let(:options) { {} }
|
|
|
|
|
|
|
|
it "doesn't disable starttls" do
|
2022-07-27 22:27:38 -04:00
|
|
|
expect(smtp_session.starttls?).to eq(:auto)
|
2022-06-07 10:58:04 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when the starttls option is set to `false`" do
|
|
|
|
let(:options) { { enable_starttls_auto: false } }
|
|
|
|
|
|
|
|
it "properly disables starttls" do
|
2022-07-27 22:27:38 -04:00
|
|
|
expect(smtp_session.starttls?).to eq(false)
|
2022-06-07 10:58:04 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|