From 593bd89095890454bc239d9dfc80899c0a936210 Mon Sep 17 00:00:00 2001 From: Konrad Date: Tue, 24 Jun 2025 18:29:58 +0200 Subject: [PATCH] Update test mailer specs to check that this super admin facing email remains unaffected by white labelling (there are no user or customer facing emails here) Also make use of the newly separated shared_examples --- spec/mailers/test_mailer_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/mailers/test_mailer_spec.rb b/spec/mailers/test_mailer_spec.rb index 191f84a344..0571640d10 100644 --- a/spec/mailers/test_mailer_spec.rb +++ b/spec/mailers/test_mailer_spec.rb @@ -3,7 +3,9 @@ require 'spec_helper' RSpec.describe Spree::TestMailer do + subject(:mail) { described_class.test_email(order) } let(:user) { create(:user) } + let(:order) { build(:order_with_distributor) } context ":from not set explicitly" do it "falls back to spree config" do @@ -18,4 +20,9 @@ RSpec.describe Spree::TestMailer do Spree::TestMailer.test_email(user.id).deliver_now }.not_to raise_error end + + context "white labelling" do + it_behaves_like 'email with inactive white labelling', :mail + it_behaves_like 'non-customer facing email with active white labelling', :mail + end end