diff options
Diffstat (limited to 'spec/workers/email_receiver_worker_spec.rb')
-rw-r--r-- | spec/workers/email_receiver_worker_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/workers/email_receiver_worker_spec.rb b/spec/workers/email_receiver_worker_spec.rb index e4e77c667b3..045135255d6 100644 --- a/spec/workers/email_receiver_worker_spec.rb +++ b/spec/workers/email_receiver_worker_spec.rb @@ -46,6 +46,21 @@ describe EmailReceiverWorker, :mailer do should_not_email_anyone end end + + context 'when the error is Gitlab::Email::InvalidAttachment' do + let(:error) { Gitlab::Email::InvalidAttachment.new("Could not deal with that") } + + it 'reports the error to the sender' do + perform_enqueued_jobs do + described_class.new.perform(raw_message) + end + + email = ActionMailer::Base.deliveries.last + expect(email).not_to be_nil + expect(email.to).to eq(["jake@adventuretime.ooo"]) + expect(email.body.parts.last.to_s).to include("Could not deal with that") + end + end end end |