diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-01-17 14:50:49 -0500 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-01-20 20:19:22 +0800 |
commit | d15b7db1216f220b9f5af7e777cf04712483cbdf (patch) | |
tree | 697452bdb1490c95596a9b2419e62e2e2af7d28e /spec/lib/gitlab/incoming_email_spec.rb | |
parent | 491f1375fc055805c623a3079a383de988689f3d (diff) | |
download | gitlab-ce-d15b7db1216f220b9f5af7e777cf04712483cbdf.tar.gz |
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.rb | 15 |
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 |