template.rb 941 B

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :template do
  4. name { Faker::Name.unique.name }
  5. options { {} }
  6. updated_by_id { 1 }
  7. created_by_id { 1 }
  8. transient do
  9. title { 'Title dummy.' }
  10. body { 'Content dummy.' }
  11. sender_type { 'email-out' }
  12. customer { create(:customer) }
  13. group { Group.first }
  14. owner { create(:agent) }
  15. end
  16. trait :dummy_data do
  17. options do
  18. {
  19. 'formSenderType' => sender_type,
  20. 'title' => title,
  21. 'body' => body,
  22. 'customer_id' => customer.id,
  23. 'customer_id_completion' => "#{customer.firstname} #{customer.lastname} <#{customer.email}>",
  24. 'group_id' => group.id,
  25. 'owner_id' => owner.id,
  26. }
  27. end
  28. end
  29. end
  30. end