mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
Do not display OFN banner on order confirmation email if white label
This commit is contained in:
@@ -28,6 +28,7 @@ module Spree
|
||||
|
||||
def confirm_email_for_customer(order_or_order_id, resend = false)
|
||||
@order = find_order(order_or_order_id)
|
||||
@hide_ofn_navigation = @order.distributor.hide_ofn_navigation
|
||||
I18n.with_locale valid_locale(@order.user) do
|
||||
subject = mail_subject(t('spree.order_mailer.confirm_email.subject'), resend)
|
||||
mail(to: @order.email,
|
||||
|
||||
@@ -44,6 +44,20 @@ describe Spree::OrderMailer do
|
||||
described_class.confirm_email_for_customer(order.id).deliver_now
|
||||
}.to_not raise_error
|
||||
end
|
||||
|
||||
it "display the OFN header by default" do
|
||||
expect(email.body).to include(ContentConfig.url_for(:footer_logo))
|
||||
end
|
||||
|
||||
context 'when hide OFN navigation is enabled for the distributor of the order' do
|
||||
before do
|
||||
allow(order.distributor).to receive(:hide_ofn_navigation).and_return(true)
|
||||
end
|
||||
|
||||
it 'does not display the OFN navigation' do
|
||||
expect(email.body).to_not include(ContentConfig.url_for(:footer_logo))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#confirm_email_for_shop' do
|
||||
|
||||
Reference in New Issue
Block a user