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
This commit is contained in:
Konrad
2025-06-24 18:29:58 +02:00
parent 0079ed219b
commit 593bd89095

View File

@@ -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