checklist.rb 417 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :checklist do
  4. name { '' }
  5. sorted_item_ids { [] }
  6. ticket
  7. transient do
  8. item_count { 5 }
  9. end
  10. after(:create) do |checklist, context|
  11. next if context.item_count.blank?
  12. create_list(:checklist_item, context.item_count, checklist: checklist)
  13. end
  14. end
  15. end