Use 4.0 api for job fakes (as opposed to master)
This commit is contained in:
parent
426299d261
commit
a22abda594
|
@ -6,9 +6,8 @@ require 'sidekiq/testing'
|
||||||
describe Topic do
|
describe Topic do
|
||||||
|
|
||||||
def scheduled_jobs_for(job_name, params={})
|
def scheduled_jobs_for(job_name, params={})
|
||||||
Sidekiq::Queues["default"].select do |job|
|
"Jobs::#{job_name.to_s.camelcase}".constantize.jobs.select do |job|
|
||||||
job_args = job['args'][0]
|
job_args = job['args'][0]
|
||||||
if job['class'] == "Jobs::#{job_name.to_s.camelcase}"
|
|
||||||
matched = true
|
matched = true
|
||||||
params.each do |key, value|
|
params.each do |key, value|
|
||||||
unless job_args[key.to_s] == value
|
unless job_args[key.to_s] == value
|
||||||
|
@ -19,12 +18,11 @@ describe Topic do
|
||||||
matched
|
matched
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
before {
|
before {
|
||||||
Sidekiq::Queues.clear_all
|
|
||||||
SiteSetting.queue_jobs = true
|
SiteSetting.queue_jobs = true
|
||||||
|
Jobs::CloseTopic.jobs.clear
|
||||||
}
|
}
|
||||||
|
|
||||||
context 'creating a topic without auto-close' do
|
context 'creating a topic without auto-close' do
|
||||||
|
@ -44,7 +42,6 @@ describe Topic do
|
||||||
|
|
||||||
context 'jobs may be queued' do
|
context 'jobs may be queued' do
|
||||||
before do
|
before do
|
||||||
Sidekiq::Queues.clear_all
|
|
||||||
Timecop.freeze(Time.zone.now)
|
Timecop.freeze(Time.zone.now)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue