mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-28 21:07:16 +00:00
Asserts that the enterprise welcome email has no reply to address
Asserts that manager invitation email has the inviting enterprise as reply to address
This commit is contained in:
@@ -14,6 +14,11 @@ RSpec.describe EnterpriseMailer do
|
||||
expect(mail.subject)
|
||||
.to eq "#{enterprise.name} is now on #{Spree::Config[:site_name]}"
|
||||
end
|
||||
|
||||
it "does not set a reply-to email" do
|
||||
EnterpriseMailer.welcome(enterprise).deliver_now
|
||||
expect(ActionMailer::Base.deliveries.first.reply_to).to be nil
|
||||
end
|
||||
end
|
||||
|
||||
describe "#manager_invitation" do
|
||||
@@ -23,5 +28,10 @@ RSpec.describe EnterpriseMailer do
|
||||
mail = ActionMailer::Base.deliveries.first
|
||||
expect(mail.subject).to eq "#{enterprise.name} has invited you to be a manager"
|
||||
end
|
||||
|
||||
it "sets a reply-to of the enterprise email" do
|
||||
EnterpriseMailer.manager_invitation(enterprise, user).deliver_now
|
||||
expect(ActionMailer::Base.deliveries.first.reply_to).to eq([enterprise.contact.email])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user