link.rb 696 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :link do
  4. transient do
  5. link_type { 'normal' }
  6. link_object_source { from.class.name }
  7. link_object_target { to.class.name }
  8. from { Ticket.first }
  9. to { Ticket.last }
  10. end
  11. link_type_id { Link::Type.create_if_not_exists(name: link_type, active: true).id }
  12. link_object_source_id { Link::Object.create_if_not_exists(name: link_object_source).id }
  13. link_object_target_id { Link::Object.create_if_not_exists(name: link_object_target).id }
  14. link_object_source_value { from.id }
  15. link_object_target_value { to.id }
  16. end
  17. end