Sha256: 2c1a4ac7a15016459b5004f94d6eb72a1d513d85f115c705ad4622655ebc3818
Contents?: true
Size: 876 Bytes
Versions: 10
Compression:
Stored size: 876 Bytes
Contents
require 'spec_helper' module Marty describe BackgroundJob::FetchMissingInScheduleCronJobs do before do schedule = Marty::BackgroundJob::Schedule.create!( job_class: 'TestJob', cron: '0 0 * * *', state: 'on' ) Marty::Jobs::Schedule.call dj = TestJob.delayed_job TestJob.delayed_job.dup.tap do |new_dj| new_dj.handler = new_dj.handler.gsub('TestJob', 'Test2Job') new_dj.cron = nil new_dj.save! end TestJob.delayed_job.dup.tap do |new_dj| new_dj.handler = new_dj.handler.gsub('TestJob', 'MissingJob') new_dj.save! end end it 'fetchs only jobs that have cron and are not present in the dashboard' do result = described_class.call expect(result.size).to eq 1 expect(result.first.handler).to include('MissingJob') end end end
Version data entries
10 entries across 10 versions & 1 rubygems