checklist_template.rb 534 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :checklist_template do
  4. name { Faker::Name.unique.name }
  5. updated_by_id { 1 }
  6. created_by_id { 1 }
  7. active { true }
  8. sorted_item_ids { [] }
  9. transient do
  10. item_count { 5 }
  11. end
  12. after(:create) do |checklist, context|
  13. next if context.item_count.blank?
  14. create_list(:checklist_template_item, context.item_count, checklist_template: checklist)
  15. end
  16. end
  17. end