discourse/spec/multisite/pausable_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
481 B
Ruby
Raw Normal View History

# frozen_string_literal: true
RSpec.describe Sidekiq::Pausable do
after do
Sidekiq.unpause_all!
end
it "can still run heartbeats when paused" do
Sidekiq.pause!
freeze_time 1.week.from_now
jobs = Sidekiq::ScheduledSet.new
jobs.clear
middleware = Sidekiq::Pausable.new
middleware.call(Jobs::RunHeartbeat.new, { "args" => [{}] }, "critical") do
"done"
end
jobs = Sidekiq::ScheduledSet.new
expect(jobs.size).to eq(0)
end
end