mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Previously we only set these part-way through deployment, so the values could be out of sync between our ENV vars and Spree::Config (which itself is a mix of both cached values and database-persisted values).
33 lines
1.3 KiB
Ruby
33 lines
1.3 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
describe MailConfiguration do
|
|
describe 'apply!' do
|
|
before do
|
|
allow(Spree::Core::MailSettings).to receive(:init) { true }
|
|
end
|
|
|
|
it 'sets config entries in the Spree Config' do
|
|
allow(Spree::Config).to receive(:[]=)
|
|
|
|
described_class.apply!
|
|
expect(Spree::Config).to have_received(:[]=).with(:mail_host, "example.com")
|
|
expect(Spree::Config).to have_received(:[]=).with(:mail_domain, "example.com")
|
|
expect(Spree::Config).to have_received(:[]=).with(:mail_port, "25")
|
|
expect(Spree::Config).to have_received(:[]=).with(:mail_auth_type, "login")
|
|
expect(Spree::Config).to have_received(:[]=).with(:smtp_username, "ofn")
|
|
expect(Spree::Config).to have_received(:[]=).with(:smtp_password, "f00d")
|
|
expect(Spree::Config).to have_received(:[]=).with(:secure_connection_type, "None")
|
|
expect(Spree::Config).to have_received(:[]=).with(:mails_from, "no-reply@example.com")
|
|
expect(Spree::Config).to have_received(:[]=).with(:mail_bcc, "")
|
|
expect(Spree::Config).to have_received(:[]=).with(:intercept_email, "")
|
|
end
|
|
|
|
it 'initializes the mail settings' do
|
|
described_class.apply!
|
|
expect(Spree::Core::MailSettings).to have_received(:init)
|
|
end
|
|
end
|
|
end
|