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:
authorLin Jen-Shin <godfat@godfat.org>2017-01-17 22:50:49 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-01-20 15:19:22 +0300
commitd15b7db1216f220b9f5af7e777cf04712483cbdf (patch)
tree697452bdb1490c95596a9b2419e62e2e2af7d28e /spec/lib/gitlab/incoming_email_spec.rb
parent491f1375fc055805c623a3079a383de988689f3d (diff)
Fix References header parser for Microsoft Exchange
Microsoft Exchange would append a comma and another message id into the References header, therefore we'll need to fallback and parse the header by ourselves. Closes #26567
Diffstat (limited to 'spec/lib/gitlab/incoming_email_spec.rb')
-rw-r--r--spec/lib/gitlab/incoming_email_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/incoming_email_spec.rb b/spec/lib/gitlab/incoming_email_spec.rb
index 1dcf2c0668b..01d0cb6cbd6 100644
--- a/spec/lib/gitlab/incoming_email_spec.rb
+++ b/spec/lib/gitlab/incoming_email_spec.rb
@@ -48,4 +48,19 @@ describe Gitlab::IncomingEmail, lib: true do
expect(described_class.key_from_fallback_message_id('reply-key@localhost')).to eq('key')
end
end
+
+ context 'self.scan_fallback_references' do
+ let(:references) do
+ '<issue_1@localhost>' +
+ ' <reply-59d8df8370b7e95c5a49fbf86aeb2c93@localhost>' +
+ ',<exchange@microsoft.com>'
+ end
+
+ it 'returns reply key' do
+ expect(described_class.scan_fallback_references(references))
+ .to eq(%w[issue_1@localhost
+ reply-59d8df8370b7e95c5a49fbf86aeb2c93@localhost
+ exchange@microsoft.com])
+ end
+ end
end