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 :link do
|
2019-02-10 12:24:22 +00:00
|
|
|
transient do
|
2020-11-06 09:46:48 +00:00
|
|
|
link_type { 'normal' }
|
2021-04-27 08:17:15 +00:00
|
|
|
link_object_source { from.class.name }
|
|
|
|
link_object_target { to.class.name }
|
2019-02-10 12:24:22 +00:00
|
|
|
from { Ticket.first }
|
|
|
|
to { Ticket.last }
|
|
|
|
end
|
|
|
|
|
2020-11-06 09:46:48 +00:00
|
|
|
link_type_id { Link::Type.create_if_not_exists(name: link_type, active: true).id }
|
|
|
|
link_object_source_id { Link::Object.create_if_not_exists(name: link_object_source).id }
|
|
|
|
link_object_target_id { Link::Object.create_if_not_exists(name: link_object_target).id }
|
2019-02-10 12:24:22 +00:00
|
|
|
link_object_source_value { from.id }
|
|
|
|
link_object_target_value { to.id }
|
2017-05-02 11:37:20 +00:00
|
|
|
end
|
|
|
|
end
|