scheduler.rb 1017 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :scheduler do
  4. sequence(:name) { |n| "Testscheduler#{n}" }
  5. last_run { Time.zone.now }
  6. pid { 1337 }
  7. prio { 1 }
  8. status { 'ok' }
  9. active { true }
  10. period { 10.minutes }
  11. running { false }
  12. note { 'test' }
  13. updated_by_id { 1 }
  14. created_by_id { 1 }
  15. created_at { 1 }
  16. updated_at { 1 }
  17. add_attribute(:method) { 'test' }
  18. trait :timeplan do
  19. timeplan do
  20. { days: { Mon: true,
  21. Tue: true,
  22. Wed: true,
  23. Thu: true,
  24. Fri: true,
  25. Sat: true,
  26. Sun: true },
  27. hours: { 23 => true },
  28. minutes: { 0 => true } }
  29. end
  30. end
  31. end
  32. end