mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 01:15:47 +08:00
48b92d8897
Mixing multisite and standard specs can lead to issues (e.g. when using `fab!`) Disabled the (upcoming https://github.com/discourse/rubocop-discourse/pull/11) rubocop rule for two files that have thoroughly tangled both types of specs.
27 lines
505 B
Ruby
27 lines
505 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
|
|
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
|