calendar.rb 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. FactoryBot.define do
  2. factory :calendar do
  3. sequence(:name) { |n| "Escalation Test #{n}" }
  4. timezone { 'Europe/Berlin' }
  5. default { true }
  6. ical_url { nil }
  7. business_hours do
  8. {
  9. mon: {
  10. active: true,
  11. timeframes: [['09:00', '17:00']]
  12. },
  13. tue: {
  14. active: true,
  15. timeframes: [['09:00', '17:00']]
  16. },
  17. wed: {
  18. active: true,
  19. timeframes: [['09:00', '17:00']]
  20. },
  21. thu: {
  22. active: true,
  23. timeframes: [['09:00', '17:00']]
  24. },
  25. fri: {
  26. active: true,
  27. timeframes: [['09:00', '17:00']]
  28. },
  29. sat: {
  30. active: false,
  31. timeframes: [['09:00', '17:00']]
  32. },
  33. sun: {
  34. active: false,
  35. timeframes: [['09:00', '17:00']]
  36. }
  37. }
  38. end
  39. created_by_id { 1 }
  40. updated_by_id { 1 }
  41. trait :'24/7' do
  42. business_hours do
  43. {
  44. mon: {
  45. active: true,
  46. timeframes: [ ['00:00', '24:00'] ]
  47. },
  48. tue: {
  49. active: true,
  50. timeframes: [ ['00:00', '24:00'] ]
  51. },
  52. wed: {
  53. active: true,
  54. timeframes: [ ['00:00', '24:00'] ]
  55. },
  56. thu: {
  57. active: true,
  58. timeframes: [ ['00:00', '24:00'] ]
  59. },
  60. fri: {
  61. active: true,
  62. timeframes: [ ['00:00', '24:00'] ]
  63. },
  64. sat: {
  65. active: true,
  66. timeframes: [ ['00:00', '24:00'] ]
  67. },
  68. sun: {
  69. active: true,
  70. timeframes: [ ['00:00', '24:00'] ]
  71. },
  72. }
  73. end
  74. end
  75. end
  76. end