link.rb 428 B

1234567891011121314
  1. FactoryBot.define do
  2. factory :link do
  3. transient do
  4. from { Ticket.first }
  5. to { Ticket.last }
  6. end
  7. link_type_id { Link::Type.find_by(name: 'normal').id }
  8. link_object_source_id { Link::Object.find_by(name: 'Ticket').id }
  9. link_object_target_id { Link::Object.find_by(name: 'Ticket').id }
  10. link_object_source_value { from.id }
  11. link_object_target_value { to.id }
  12. end
  13. end