fix: Automations condition based quoted text (#7272)

This commit is contained in:
Tejaswini Chile
2023-06-09 17:00:05 +05:30
committed by GitHub
parent f64f2138db
commit 879a244f93
8 changed files with 107 additions and 63 deletions

View File

@@ -201,6 +201,7 @@ RSpec.describe Message do
message.inbox = create(:inbox, account: message.account, channel: build(:channel_email, account: message.account))
allow(EmailReplyWorker).to receive(:perform_in).and_return(true)
message.message_type = 'outgoing'
message.content_attributes = { email: { text_content: { quoted: 'quoted text' } } }
message.save!
expect(EmailReplyWorker).to have_received(:perform_in).with(1.second, message.id)
end
@@ -223,6 +224,15 @@ RSpec.describe Message do
end
end
context 'when processed_message_content is blank' do
let(:message) { build(:message, content_type: :text, account: create(:account), content: 'Processed message content') }
it 'sets content_type as text' do
message.save!
expect(message.processed_message_content).to eq message.content
end
end
context 'when attachments size maximum' do
let(:message) { build(:message, content_type: nil, account: create(:account)) }