ticket.rb 724 B

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