mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 20:54:31 +08:00
c9dab6fd08
It's very easy to forget to add `require 'rails_helper'` at the top of every core/plugin spec file, and omissions can cause some very confusing/sporadic errors. By setting this flag in `.rspec`, we can remove the need for `require 'rails_helper'` entirely.
25 lines
481 B
Ruby
25 lines
481 B
Ruby
# 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
|