2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2019-01-21 17:17:18 +00:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :template do
|
|
|
|
name { Faker::Name.unique.name }
|
|
|
|
options { {} }
|
|
|
|
updated_by_id { 1 }
|
|
|
|
created_by_id { 1 }
|
2020-04-30 15:38:57 +00:00
|
|
|
|
|
|
|
transient do
|
|
|
|
title { 'Title dummy.' }
|
|
|
|
body { 'Content dummy.' }
|
|
|
|
sender_type { 'email-out' }
|
2020-06-19 09:17:18 +00:00
|
|
|
customer { create(:customer) }
|
2020-04-30 15:38:57 +00:00
|
|
|
group { Group.first }
|
2020-06-19 09:17:18 +00:00
|
|
|
owner { create(:agent) }
|
2020-04-30 15:38:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :dummy_data do
|
|
|
|
options do
|
|
|
|
{
|
2020-06-02 11:01:16 +00:00
|
|
|
'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,
|
2020-04-30 15:38:57 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2019-01-21 17:17:18 +00:00
|
|
|
end
|
|
|
|
end
|