history.rb 468 B

12345678910111213141516171819202122232425
  1. FactoryBot.define do
  2. factory :history do
  3. transient do
  4. o { Ticket.first }
  5. history_type { 'update' }
  6. history_attribute { 'state' }
  7. end
  8. o_id { o.id }
  9. created_by_id { 1 }
  10. history_type_id do
  11. History.type_lookup(history_type).id
  12. end
  13. history_attribute_id do
  14. History.attribute_lookup(history_attribute).id
  15. end
  16. history_object_id do
  17. History.object_lookup(o.class.name).id
  18. end
  19. end
  20. end