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
|
2019-02-05 07:33:40 +00:00
|
|
|
|
|
|
|
trait :with_preferences do
|
|
|
|
preferences { Cti::CallerId.get_comment_preferences(from, 'from')&.last }
|
|
|
|
end
|
2018-05-28 06:42:04 +00:00
|
|
|
end
|
|
|
|
end
|