tag.rb 424 B

1234567891011121314151617
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :tag do
  4. transient do
  5. o { Ticket.first }
  6. end
  7. tag_item_id { Tag::Item.lookup_by_name_and_create('blub').id }
  8. o_id { o.id }
  9. created_by_id { 1 }
  10. tag_object_id do
  11. Tag::Object.lookup(name: o.class.name)&.id || create(:'tag/object', name: o.class.name).id
  12. end
  13. end
  14. end