mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Asserts that the order cancellation email for customer has the distributors email as reply to address
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user