checklist_template.rb 481 B

12345678910111213141516171819
  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. active { true }
  6. sorted_item_ids { [] }
  7. transient do
  8. item_count { 5 }
  9. end
  10. after(:create) do |checklist, context|
  11. next if context.item_count.blank?
  12. checklist.replace_items! Array.new(context.item_count) { Faker::Lorem.unique.sentence }
  13. end
  14. end
  15. end