From 80fc0a57902fac1a208e5f5c24058becbec0841e Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 23 Jun 2025 12:14:11 +0500 Subject: [PATCH] Exclude customer personal information from order summary in email --- spec/mailers/producer_mailer_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/mailers/producer_mailer_spec.rb b/spec/mailers/producer_mailer_spec.rb index cadeab6cdf..8657fc09b9 100644 --- a/spec/mailers/producer_mailer_spec.rb +++ b/spec/mailers/producer_mailer_spec.rb @@ -237,6 +237,12 @@ RSpec.describe ProducerMailer do expect(table).not_to have_selector("th", text: "Last Name") expect(table).not_to have_selector("th", text: "Phone") expect(table).not_to have_selector("th", text: "Email") + + row = parsed_email.find("table.order-summary.customer-order tbody tr") + expect(row).not_to have_selector("td", text: order.billing_address.phone) + expect(row).not_to have_selector("td", text: order.customer.email) + expect(row).not_to have_selector("td", text: order.billing_address.lastname) + expect(row).not_to have_selector("td", text: order.billing_address.firstname) end end end