2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-11-21 21:50:03 +00:00
|
|
|
FactoryBot.define do
|
2017-05-02 11:37:20 +00:00
|
|
|
factory :ticket do
|
2019-03-11 07:28:18 +00:00
|
|
|
transient do
|
2019-03-27 09:01:36 +00:00
|
|
|
state_name { 'new' }
|
|
|
|
priority_name { '2 normal' }
|
2019-03-11 07:28:18 +00:00
|
|
|
end
|
|
|
|
|
2020-06-22 09:57:45 +00:00
|
|
|
association :group, strategy: :create # or else build(:ticket).save fails
|
2019-03-27 09:01:36 +00:00
|
|
|
|
2019-02-04 06:56:18 +00:00
|
|
|
customer
|
2019-03-27 09:01:36 +00:00
|
|
|
title { 'Test Ticket' }
|
2019-03-11 07:28:18 +00:00
|
|
|
state { Ticket::State.lookup(name: state_name) }
|
|
|
|
priority { Ticket::Priority.lookup(name: priority_name) }
|
2019-02-04 06:56:18 +00:00
|
|
|
updated_by_id { 1 }
|
|
|
|
created_by_id { 1 }
|
2018-12-13 09:06:44 +00:00
|
|
|
|
|
|
|
factory :twitter_ticket do
|
|
|
|
transient do
|
|
|
|
channel { create(:twitter_channel) }
|
|
|
|
end
|
|
|
|
|
|
|
|
preferences do
|
|
|
|
{
|
2018-12-19 17:31:51 +00:00
|
|
|
channel_id: channel.id,
|
2018-12-13 09:06:44 +00:00
|
|
|
channel_screen_name: channel.options[:user][:screen_name]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2017-05-02 11:37:20 +00:00
|
|
|
end
|
|
|
|
end
|