diff --git a/spec/mailers/order_mailer_spec.rb b/spec/mailers/order_mailer_spec.rb index ec33c45fdc..3214c808ee 100644 --- a/spec/mailers/order_mailer_spec.rb +++ b/spec/mailers/order_mailer_spec.rb @@ -160,6 +160,24 @@ RSpec.describe Spree::OrderMailer do end end + describe "#cancel_email (for_customer)" do + let(:distributor) { create(:distributor_enterprise) } + let(:order) { create(:order, distributor:, state: "canceled") } + let(:mail) { Spree::OrderMailer.cancel_email(order) } + + it "sends an email to the customer" do + expect(mail.to).to eq([order.email]) + end + + it "displays the order number" do + expect(mail.body).to include(order.number.to_s) + end + + it "sets a reply-to of the customer email" do + expect(mail.reply_to).to eq([order.distributor.contact.email]) + end + end + describe "order confimation" do let(:bill_address) { create(:address) } let(:distributor_address) {