It's for Message-ID so it should be message_id

This commit is contained in:
Lin Jen-Shin 2016-05-20 18:21:58 -05:00
parent c2bc15a766
commit 32eae15f2f
3 changed files with 6 additions and 6 deletions

View file

@ -60,7 +60,7 @@ module Gitlab
def key_from_additional_headers def key_from_additional_headers
Array(mail.references).find do |mail_id| Array(mail.references).find do |mail_id|
key = Gitlab::IncomingEmail.key_from_fallback_reply_mail_id(mail_id) key = Gitlab::IncomingEmail.key_from_fallback_message_id(mail_id)
break key if key break key if key
end end
end end

View file

@ -1,7 +1,7 @@
module Gitlab module Gitlab
module IncomingEmail module IncomingEmail
class << self class << self
FALLBACK_REPLY_MAIL_ID_REGEX = /\Areply\-(.+)@#{Gitlab.config.gitlab.host}\Z/.freeze FALLBACK_MESSAGE_ID_REGEX = /\Areply\-(.+)@#{Gitlab.config.gitlab.host}\Z/.freeze
def enabled? def enabled?
config.enabled && config.address config.enabled && config.address
@ -21,8 +21,8 @@ module Gitlab
match[1] match[1]
end end
def key_from_fallback_reply_mail_id(mail_id) def key_from_fallback_message_id(mail_id)
match = mail_id.match(FALLBACK_REPLY_MAIL_ID_REGEX) match = mail_id.match(FALLBACK_MESSAGE_ID_REGEX)
return unless match return unless match
match[1] match[1]

View file

@ -43,9 +43,9 @@ describe Gitlab::IncomingEmail, lib: true do
end end
end end
context 'self.key_from_fallback_reply_mail_id' do context 'self.key_from_fallback_message_id' do
it 'returns reply key' do it 'returns reply key' do
expect(described_class.key_from_fallback_reply_mail_id('reply-key@localhost')).to eq('key') expect(described_class.key_from_fallback_message_id('reply-key@localhost')).to eq('key')
end end
end end
end end