ticket.rb 801 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :ticket do
  4. transient do
  5. state_name { 'new' }
  6. priority_name { '2 normal' }
  7. end
  8. association :group, strategy: :create # or else build(:ticket).save fails
  9. customer
  10. title { 'Test Ticket' }
  11. state { Ticket::State.lookup(name: state_name) }
  12. priority { Ticket::Priority.lookup(name: priority_name) }
  13. updated_by_id { 1 }
  14. created_by_id { 1 }
  15. factory :twitter_ticket do
  16. transient do
  17. channel { create(:twitter_channel) }
  18. end
  19. preferences do
  20. {
  21. channel_id: channel.id,
  22. channel_screen_name: channel.options[:user][:screen_name]
  23. }
  24. end
  25. end
  26. end
  27. end