2017-11-21 21:50:03 +00:00
|
|
|
FactoryBot.define do
|
2019-01-22 16:35:01 +00:00
|
|
|
factory :'ticket/article', aliases: %i[ticket_article] do
|
2018-12-13 09:06:44 +00:00
|
|
|
transient do
|
2019-02-10 12:24:22 +00:00
|
|
|
type_name { 'email' }
|
|
|
|
sender_name { 'Customer' }
|
2018-12-13 09:06:44 +00:00
|
|
|
end
|
|
|
|
|
2019-03-27 09:01:36 +00:00
|
|
|
association :ticket, strategy: :create # or else build(:ticket_article).save fails
|
2019-02-10 12:24:22 +00:00
|
|
|
from { 'factory-customer-1@example.com' }
|
|
|
|
to { 'factory-customer-1@example.com' }
|
|
|
|
subject { 'factory article' }
|
|
|
|
message_id { 'factory@id_com_1' }
|
|
|
|
body { 'some message 123' }
|
|
|
|
internal { false }
|
|
|
|
sender { Ticket::Article::Sender.find_by(name: sender_name) }
|
|
|
|
type { Ticket::Article::Type.find_by(name: type_name) }
|
|
|
|
updated_by_id { 1 }
|
|
|
|
created_by_id { 1 }
|
2018-12-13 09:06:44 +00:00
|
|
|
|
|
|
|
factory :twitter_article do
|
|
|
|
transient do
|
2019-02-10 12:24:22 +00:00
|
|
|
type_name { 'twitter status' }
|
2018-12-13 09:06:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
association :ticket, factory: :twitter_ticket
|
|
|
|
body { Faker::Lorem.sentence }
|
|
|
|
end
|
2019-11-07 10:01:58 +00:00
|
|
|
|
|
|
|
factory :twitter_dm_article do
|
|
|
|
transient do
|
|
|
|
type_name { 'twitter direct-message' }
|
|
|
|
end
|
|
|
|
|
|
|
|
association :ticket, factory: :twitter_ticket
|
|
|
|
body { Faker::Lorem.sentence }
|
|
|
|
end
|
2017-05-05 09:16:47 +00:00
|
|
|
end
|
|
|
|
end
|