From a22abda594c1320618b06e9ce672933103bf1c62 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Fri, 1 Jan 2016 15:48:49 +1100 Subject: [PATCH] Use 4.0 api for job fakes (as opposed to master) --- spec/integration/topic_auto_close_spec.rb | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/spec/integration/topic_auto_close_spec.rb b/spec/integration/topic_auto_close_spec.rb index 1330d278c24..6f1d5fa2e10 100644 --- a/spec/integration/topic_auto_close_spec.rb +++ b/spec/integration/topic_auto_close_spec.rb @@ -6,25 +6,23 @@ require 'sidekiq/testing' describe Topic do 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] - if job['class'] == "Jobs::#{job_name.to_s.camelcase}" - matched = true - params.each do |key, value| - unless job_args[key.to_s] == value - matched = false - break - end + matched = true + params.each do |key, value| + unless job_args[key.to_s] == value + matched = false + break end - matched end + matched end end before { - Sidekiq::Queues.clear_all SiteSetting.queue_jobs = true + Jobs::CloseTopic.jobs.clear } context 'creating a topic without auto-close' do @@ -44,7 +42,6 @@ describe Topic do context 'jobs may be queued' do before do - Sidekiq::Queues.clear_all Timecop.freeze(Time.zone.now) end