Files
chatwoot/spec/factories/automation_rules.rb
Sojan Jose 7930902ec8 chore: Refactor Automation Specs (#6796)
The current way of writing specs for automation in one single file automation_listener isn't effective. Hence we are breaking down the specs for each class into separate spec files.

fixes: CW-1447
2023-03-30 21:02:52 +05:30

21 lines
787 B
Ruby

FactoryBot.define do
factory :automation_rule do
account
name { 'Test Automation Rule' }
event_name { 'conversation_status_changed' }
conditions { [{ 'values': ['resolved'], 'attribute_key': 'status', 'query_operator': nil, 'filter_operator': 'equal_to' }] }
actions do
[
{
'action_name' => 'send_email_to_team', 'action_params' => {
'message' => 'Please pay attention to this conversation, its from high priority customer', 'team_ids' => [1]
}
},
{ 'action_name' => 'assign_team', 'action_params' => [1] },
{ 'action_name' => 'add_label', 'action_params' => %w[support priority_customer] },
{ 'action_name' => 'assign_agent', 'action_params' => [1, 2, 3, 4] }
]
end
end
end