feat: Add the ability to un-assign teams using automation (#9668)

Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
Clairton Rodrigo Heinzen
2024-06-26 16:40:36 -03:00
committed by GitHub
parent f7f687ce53
commit 96f4f50d2d
5 changed files with 60 additions and 9 deletions

View File

@@ -16,5 +16,17 @@ FactoryBot.define do
conversation.contact ||= create(:contact, :with_email, account: conversation.account)
conversation.contact_inbox ||= create(:contact_inbox, contact: conversation.contact, inbox: conversation.inbox)
end
trait :with_team do
after(:build) do |conversation|
conversation.team ||= create(:team, account: conversation.account)
end
end
trait :with_assignee do
after(:build) do |conversation|
conversation.assignee ||= create(:user, account: conversation.account, role: :agent)
end
end
end
end