trabajo-afectivo/spec/factories/template.rb
2022-01-01 14:38:12 +01:00

33 lines
941 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
FactoryBot.define do
factory :template do
name { Faker::Name.unique.name }
options { {} }
updated_by_id { 1 }
created_by_id { 1 }
transient do
title { 'Title dummy.' }
body { 'Content dummy.' }
sender_type { 'email-out' }
customer { create(:customer) }
group { Group.first }
owner { create(:agent) }
end
trait :dummy_data do
options do
{
'formSenderType' => sender_type,
'title' => title,
'body' => body,
'customer_id' => customer.id,
'customer_id_completion' => "#{customer.firstname} #{customer.lastname} <#{customer.email}>",
'group_id' => group.id,
'owner_id' => owner.id,
}
end
end
end
end