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:
filipefurtad0
2025-03-26 08:03:36 +00:00
parent 9fa42cae47
commit c95c598f82

View File

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