|
|
|
|
@ -21,8 +21,9 @@ RSpec.describe Mastodon::EmailConfigurationHelper do
|
|
|
|
|
base_configuration.merge({ enable_starttls: 'always' })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'converts this to `true`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to be true
|
|
|
|
|
it 'converts this to `:always`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to eq :always
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be_nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@ -33,6 +34,7 @@ RSpec.describe Mastodon::EmailConfigurationHelper do
|
|
|
|
|
|
|
|
|
|
it 'converts this to `false`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to be false
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be_nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@ -41,28 +43,43 @@ RSpec.describe Mastodon::EmailConfigurationHelper do
|
|
|
|
|
base_configuration.merge({ enable_starttls: 'auto' })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'sets `enable_starttls_auto` instead' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to be_nil
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be true
|
|
|
|
|
it 'sets `enable_starttls` to `:auto`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to eq :auto
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be_nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'when `enable_starttls` is unset' do
|
|
|
|
|
context 'when `enable_starttls_auto` is unset' do
|
|
|
|
|
let(:configuration) { base_configuration }
|
|
|
|
|
context 'when `enable_starttls_auto` is true' do
|
|
|
|
|
let(:configuration) do
|
|
|
|
|
base_configuration.merge({ enable_starttls_auto: true })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'sets `enable_starttls` to `:auto`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to eq :auto
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be_nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'when `tls` is set to true' do
|
|
|
|
|
let(:configuration) do
|
|
|
|
|
base_configuration.merge({ tls: true })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'sets `enable_starttls_auto` to `true`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be true
|
|
|
|
|
it 'sets `enable_starttls` to `nil`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to be_nil
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be_nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'when `enable_starttls_auto` is set to "false"' do
|
|
|
|
|
context 'when `enable_starttls_auto` is set to false' do
|
|
|
|
|
let(:configuration) do
|
|
|
|
|
base_configuration.merge({ enable_starttls_auto: 'false' })
|
|
|
|
|
base_configuration.merge({ enable_starttls_auto: false })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'sets `enable_starttls_auto` to `false`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be false
|
|
|
|
|
it 'sets `enable_starttls` to `false`' do
|
|
|
|
|
expect(converted_settings[:enable_starttls]).to be false
|
|
|
|
|
expect(converted_settings[:enable_starttls_auto]).to be_nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|