webhook.rb 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :webhook do
  4. sequence(:name) { |n| "Test webhook #{n}" }
  5. endpoint { 'http://example.com/endpoint' }
  6. ssl_verify { true }
  7. active { true }
  8. created_by_id { 1 }
  9. updated_by_id { 1 }
  10. custom_payload { nil }
  11. customized_payload { false }
  12. factory :mattermost_webhook do
  13. name { 'Mattermost Notifications' }
  14. endpoint { 'https://example.com/mattermost' }
  15. pre_defined_webhook_type { 'Mattermost' }
  16. note { 'Pre-defined webhook for Mattermost Notifications.' }
  17. preferences do
  18. {
  19. pre_defined_webhook: {
  20. messaging_username: Faker::Internet.unique.username,
  21. messaging_channel: Faker::Internet.unique.slug,
  22. messaging_icon_url: Faker::Internet.unique.url,
  23. },
  24. }
  25. end
  26. end
  27. factory :ms_teams_webhook do
  28. name { 'Microsoft Teams Notifications' }
  29. endpoint { 'https://example.com/msteams' }
  30. pre_defined_webhook_type { 'MicrosoftTeams' }
  31. note { 'Pre-defined webhook for Microsoft Teams Notifications.' }
  32. end
  33. factory :rocketchat_webhook do
  34. name { 'Rocket Chat Notifications' }
  35. endpoint { 'https://example.com/rocket_chat' }
  36. pre_defined_webhook_type { 'RocketChat' }
  37. note { 'Pre-defined webhook for Rocket Chat Notifications.' }
  38. preferences do
  39. {
  40. pre_defined_webhook: {
  41. messaging_username: Faker::Internet.unique.username,
  42. messaging_channel: Faker::Internet.unique.slug,
  43. messaging_icon_url: Faker::Internet.unique.url,
  44. },
  45. }
  46. end
  47. end
  48. factory :slack_webhook do
  49. name { 'Slack Notifications' }
  50. endpoint { 'https://example.com/slack' }
  51. pre_defined_webhook_type { 'Slack' }
  52. note { 'Pre-defined webhook for Slack Notifications.' }
  53. end
  54. end
  55. end