template.rb 874 B

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