history.rb 545 B

123456789101112131415161718192021222324252627
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :history do
  4. transient do
  5. o { Ticket.first }
  6. history_type { 'update' }
  7. history_attribute { 'state' }
  8. end
  9. o_id { o.id }
  10. created_by_id { 1 }
  11. history_type_id do
  12. History.type_lookup(history_type).id
  13. end
  14. history_attribute_id do
  15. History.attribute_lookup(history_attribute).id
  16. end
  17. history_object_id do
  18. History.object_lookup(o.class.name).id
  19. end
  20. end
  21. end