diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-06 22:33:21 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-06 22:33:21 +0300 |
commit | e6f5177b75e5b5bdd2ab56da88d546f90ee1e080 (patch) | |
tree | 1f0a9c3c6985a957948172096d2e90cb4e61bc6e /spec/lib | |
parent | c25ac43276a2787152f2194a845f695c628a03d3 (diff) | |
parent | bec10d5852a8820de4002af25dd7fbb705561718 (diff) |
Merge branch 'fix-references-header-parsing' into 'master'
Fix References header parser for Microsoft Exchange
Closes #26567
See merge request !8620
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/email/handler/create_note_handler_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab/incoming_email_spec.rb | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb index 17a4ef25210..b300feaabe1 100644 --- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb @@ -174,6 +174,12 @@ describe Gitlab::Email::Handler::CreateNoteHandler, lib: true do it_behaves_like 'an email that contains a mail key', 'References' end + + context 'mail key is in the References header with a comma' do + let(:email_raw) { fixture_file('emails/reply_without_subaddressing_and_key_inside_references_with_a_comma.eml') } + + it_behaves_like 'an email that contains a mail key', 'References' + end end end end diff --git a/spec/lib/gitlab/incoming_email_spec.rb b/spec/lib/gitlab/incoming_email_spec.rb index 7e951e3fcdd..698bd72d0f8 100644 --- a/spec/lib/gitlab/incoming_email_spec.rb +++ b/spec/lib/gitlab/incoming_email_spec.rb @@ -90,4 +90,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 |