Fix: Find mailbox with cc email (#4372)

This commit is contained in:
Tejaswini Chile
2022-04-08 11:20:19 +05:30
committed by GitHub
parent 14e6a5d6b0
commit 57359be37e
9 changed files with 103 additions and 12 deletions

View File

@@ -0,0 +1,29 @@
require 'rails_helper'
describe ::EmailChannelFinder do
include ActionMailbox::TestHelper
let!(:channel_email) { create(:channel_email) }
describe '#perform' do
context 'with cc mail' do
let(:reply_cc_mail) { create_inbound_email_from_fixture('reply_cc.eml') }
it 'return channel with cc email' do
channel_email.update(email: 'test@example.com')
channel = described_class.new(reply_cc_mail.mail).perform
expect(channel).to eq(channel_email)
end
end
context 'with to mail' do
let(:reply_mail) { create_inbound_email_from_fixture('reply.eml') }
it 'return channel with to email' do
channel_email.update(email: 'test@example.com')
reply_mail.mail['to'] = 'test@example.com'
channel = described_class.new(reply_mail.mail).perform
expect(channel).to eq(channel_email)
end
end
end
end