mock the delayed_job backend

pull/9611/head
ulferts 3 years ago
parent 57ed3c8fd3
commit 718b2df8f5
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 6
      spec/features/notifications/reminder_mail_spec.rb

@ -106,6 +106,12 @@ describe "Reminder email", type: :feature, js: true do
involved_work_package involved_work_package
ActiveJob::Base.queue_adapter.enqueued_jobs.clear ActiveJob::Base.queue_adapter.enqueued_jobs.clear
# There is no delayed_job associated when using the testing backend of ActiveJob
# so we have to mock it.
allow(Notifications::ScheduleReminderMailsJob)
.to receive(:delayed_job)
.and_return(instance_double(Delayed::Backend::ActiveRecord::Job, run_at: Time.current.utc))
end end
it 'sends a digest mail based on the configuration', with_settings: { journal_aggregation_time_minutes: 0 } do it 'sends a digest mail based on the configuration', with_settings: { journal_aggregation_time_minutes: 0 } do

Loading…
Cancel
Save