fix: add required argument for SMTP errors instanciation in application_mailer_spec

This commit is contained in:
Nicolas Cavigneaux 2023-03-06 10:13:43 +01:00 committed by Colin Darie
parent 5ba409ec9a
commit 7e245c0b70
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -11,7 +11,7 @@ RSpec.describe ApplicationMailer, type: :mailer do
end end
context 'when the server handles invalid emails with Net::SMTPSyntaxError' do context 'when the server handles invalid emails with Net::SMTPSyntaxError' do
let(:smtp_error) { Net::SMTPSyntaxError.new } let(:smtp_error) { Net::SMTPSyntaxError.new('400 unexpected recipients: want atleast 1, got 0') }
it { expect(subject.message).to be_an_instance_of(ActionMailer::Base::NullMail) } it { expect(subject.message).to be_an_instance_of(ActionMailer::Base::NullMail) }
end end
@ -96,7 +96,7 @@ RSpec.describe ApplicationMailer, type: :mailer do
end end
context "smtp server busy" do context "smtp server busy" do
let(:smtp_error) { Net::SMTPServerBusy.new } let(:smtp_error) { Net::SMTPServerBusy.new('451 4.7.500 Server busy') }
it "re-raise an error and creates an event" do it "re-raise an error and creates an event" do
expect { subject.deliver_now }.to change { EmailEvent.count }.by(1).and raise_error(MailDeliveryError) expect { subject.deliver_now }.to change { EmailEvent.count }.by(1).and raise_error(MailDeliveryError)