Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/email_receiver_worker_spec.rb')
-rw-r--r--spec/workers/email_receiver_worker_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/workers/email_receiver_worker_spec.rb b/spec/workers/email_receiver_worker_spec.rb
index 83e13ded7b3..83720ee132b 100644
--- a/spec/workers/email_receiver_worker_spec.rb
+++ b/spec/workers/email_receiver_worker_spec.rb
@@ -37,6 +37,15 @@ RSpec.describe EmailReceiverWorker, :mailer do
expect(email.to).to eq(["jake@adventuretime.ooo"])
expect(email.subject).to include("Rejected")
end
+
+ it 'strips out the body before passing to EmailRejectionMailer' do
+ mail = Mail.new(raw_message)
+ mail.body = nil
+
+ expect(EmailRejectionMailer).to receive(:rejection).with(anything, mail.encoded, anything).and_call_original
+
+ described_class.new.perform(raw_message)
+ end
end
context 'when the error is Gitlab::Email::AutoGeneratedEmailError' do