core_workflow.rb 970 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :core_workflow do
  4. sequence(:name) { |n| "test - workflow #{format '%07d', n}" }
  5. changeable { false }
  6. created_by_id { 1 }
  7. updated_by_id { 1 }
  8. trait :active_and_screen do
  9. transient do
  10. screen { 'edit' }
  11. end
  12. preferences { { screen: screen } }
  13. active { true }
  14. end
  15. trait :condition_group do
  16. transient do
  17. group { nil }
  18. end
  19. condition_saved do
  20. { 'ticket.group_id': { operator: 'is', value: group.id.to_s } }
  21. end
  22. end
  23. trait :perform_action do
  24. transient do
  25. object_name { 'Ticket' }
  26. key { 'ticket.priority_id' }
  27. operator { 'remove_option' }
  28. value { '3' }
  29. end
  30. perform do
  31. { key => { operator: operator, operator => value } }
  32. end
  33. object { object_name }
  34. end
  35. end
  36. end