2021-08-25 12:24:42 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :core_workflow do
|
2021-10-14 11:00:42 +00:00
|
|
|
sequence(:name) { |n| "test - workflow #{format '%07d', n}" }
|
2021-08-25 12:24:42 +00:00
|
|
|
changeable { false }
|
|
|
|
created_by_id { 1 }
|
|
|
|
updated_by_id { 1 }
|
2021-12-20 13:02:30 +00:00
|
|
|
|
|
|
|
trait :active_and_screen do
|
|
|
|
transient do
|
|
|
|
screen { 'edit' }
|
|
|
|
end
|
|
|
|
|
|
|
|
preferences { { screen: screen } }
|
|
|
|
active { true }
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :condition_group do
|
|
|
|
transient do
|
|
|
|
group { nil }
|
|
|
|
end
|
|
|
|
|
|
|
|
condition_saved do
|
|
|
|
{ 'ticket.group_id': { operator: 'is', value: group.id.to_s } }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :perform_action do
|
|
|
|
transient do
|
|
|
|
object_name { 'Ticket' }
|
|
|
|
key { 'ticket.priority_id' }
|
|
|
|
operator { 'remove_option' }
|
|
|
|
value { '3' }
|
|
|
|
end
|
|
|
|
|
|
|
|
perform do
|
|
|
|
{ key => { operator: operator, operator => value } }
|
|
|
|
end
|
|
|
|
|
|
|
|
object { object_name }
|
|
|
|
end
|
2021-08-25 12:24:42 +00:00
|
|
|
end
|
|
|
|
end
|