Chatwoot/spec/services/message_templates/template/email_collect_spec.rb
Sojan Jose 722f540b03 [Feature] Email collect message hooks (#331)
- Add email collect hook on creating conversation
- Merge contact if it already exist
2020-01-09 13:06:40 +05:30

12 lines
347 B
Ruby

require 'rails_helper'
describe ::MessageTemplates::Template::EmailCollect do
context 'when this hook is called' do
let(:conversation) { create(:conversation) }
it 'creates the email collect messages' do
described_class.new(conversation: conversation).perform
expect(conversation.messages.count).to eq(3)
end
end
end