channel.rb 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. FactoryBot.define do
  2. factory :channel do
  3. area { 'Email::Dummy' }
  4. group { ::Group.find(1) }
  5. active { true }
  6. options {}
  7. preferences {}
  8. updated_by_id { 1 }
  9. created_by_id { 1 }
  10. factory :email_channel do
  11. area { 'Email::Account' }
  12. options do
  13. {
  14. inbound: {
  15. adapter: 'null', options: {}
  16. },
  17. outbound: {
  18. adapter: 'sendmail'
  19. }
  20. }
  21. end
  22. end
  23. factory :twitter_channel do
  24. transient do
  25. custom_options { {} }
  26. end
  27. area { 'Twitter::Account' }
  28. options do
  29. {
  30. adapter: 'twitter',
  31. auth: {
  32. consumer_key: 'some',
  33. consumer_secret: 'some',
  34. oauth_token: 'key',
  35. oauth_token_secret: 'secret',
  36. },
  37. user: {
  38. id: 'system_id',
  39. screen_name: 'system_login',
  40. },
  41. sync: {
  42. import_older_tweets: true,
  43. track_retweets: true,
  44. search: [
  45. {
  46. term: 'zammad',
  47. group_id: Group.first.id
  48. },
  49. {
  50. term: 'hash_tag1',
  51. group_id: Group.first.id
  52. }
  53. ],
  54. mentions: {
  55. group_id: Group.first.id
  56. },
  57. direct_messages: {
  58. group_id: Group.first.id
  59. }
  60. }
  61. }.deep_merge(custom_options)
  62. end
  63. end
  64. end
  65. end