debian-mirror-gitlab/spec/workers/expire_job_cache_worker_spec.rb

32 lines
763 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe ExpireJobCacheWorker do
2020-04-08 14:13:33 +05:30
let_it_be(:pipeline) { create(:ci_empty_pipeline) }
2021-06-08 01:23:25 +05:30
2017-08-17 22:00:37 +05:30
let(:project) { pipeline.project }
2020-01-01 13:55:28 +05:30
2017-08-17 22:00:37 +05:30
describe '#perform' do
context 'with a job in the pipeline' do
2021-04-29 21:17:54 +05:30
let_it_be(:job) { create(:ci_build, pipeline: pipeline) }
2020-04-08 14:13:33 +05:30
let(:job_args) { job.id }
2021-11-18 22:05:49 +05:30
it_behaves_like 'an idempotent worker'
2021-11-11 11:23:49 +05:30
it_behaves_like 'worker with data consistency',
described_class,
data_consistency: :delayed
2017-08-17 22:00:37 +05:30
end
context 'when there is no job in the pipeline' do
it 'does not change the etag store' do
expect(Gitlab::EtagCaching::Store).not_to receive(:new)
2020-04-22 19:07:51 +05:30
perform_multiple(non_existing_record_id)
2017-08-17 22:00:37 +05:30
end
end
end
end