Feature: Contact Merge Action (#378)

This commit is contained in:
Sojan Jose
2019-12-24 13:27:25 +05:30
committed by Pranav Raj S
parent 32efe8676f
commit 7d85f2e046
13 changed files with 198 additions and 35 deletions

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
FactoryBot.define do
factory :contact_inbox do
contact
inbox
source_id { SecureRandom.uuid }
end
end

View File

@@ -8,17 +8,14 @@ FactoryBot.define do
agent_last_seen_at { Time.current }
locked { false }
factory :complete_conversation do
after(:build) do |conversation|
conversation.account ||= create(:account)
conversation.inbox ||= create(
:inbox,
account: conversation.account,
channel: create(:channel_widget, account: conversation.account)
)
conversation.contact ||= create(:contact, account: conversation.account)
conversation.assignee ||= create(:user)
end
after(:build) do |conversation|
conversation.account ||= create(:account)
conversation.inbox ||= create(
:inbox,
account: conversation.account,
channel: create(:channel_widget, account: conversation.account)
)
conversation.contact ||= create(:contact, account: conversation.account)
end
end
end