2018-05-28 06:42:04 +00:00
|
|
|
FactoryBot.define do
|
2019-01-17 10:19:20 +00:00
|
|
|
factory :'cti/log', aliases: %i[cti_log] do
|
2018-05-28 06:42:04 +00:00
|
|
|
direction { %w[in out].sample }
|
|
|
|
state { %w[newCall answer hangup].sample }
|
2019-01-17 10:19:20 +00:00
|
|
|
from { '4930609854180' }
|
|
|
|
to { '4930609811111' }
|
|
|
|
call_id { (Cti::Log.pluck(:call_id).map(&:to_i).max || 0).next } # has SQL UNIQUE constraint
|
2018-05-28 06:42:04 +00:00
|
|
|
end
|
|
|
|
end
|