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/lib/gitlab/email/receiver_spec.rb')
-rw-r--r--spec/lib/gitlab/email/receiver_spec.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb
index ee836fc2129..f8084d24850 100644
--- a/spec/lib/gitlab/email/receiver_spec.rb
+++ b/spec/lib/gitlab/email/receiver_spec.rb
@@ -33,7 +33,7 @@ RSpec.describe Gitlab::Email::Receiver do
metadata = receiver.mail_metadata
- expect(metadata.keys).to match_array(%i(mail_uid from_address to_address mail_key references delivered_to envelope_to x_envelope_to meta received_recipients))
+ expect(metadata.keys).to match_array(%i(mail_uid from_address to_address mail_key references delivered_to envelope_to x_envelope_to meta received_recipients cc_address))
expect(metadata[:meta]).to include(client_id: client_id, project: project.full_path)
expect(metadata[meta_key]).to eq(meta_value)
end
@@ -112,6 +112,24 @@ RSpec.describe Gitlab::Email::Receiver do
it_behaves_like 'successful receive'
end
end
+
+ context 'when in a Cc header' do
+ let(:email_raw) do
+ <<~EMAIL
+ From: jake@example.com
+ To: to@example.com
+ Cc: incoming+gitlabhq/gitlabhq+auth_token@appmail.example.com
+ Subject: Issue titile
+
+ Issue description
+ EMAIL
+ end
+
+ let(:meta_key) { :cc_address }
+ let(:meta_value) { ["incoming+gitlabhq/gitlabhq+auth_token@appmail.example.com"] }
+
+ it_behaves_like 'successful receive'
+ end
end
context 'when we cannot find a capable handler' do