gitlab-org--gitlab-foss/spec/workers/archive_trace_worker_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
672 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-01-29 16:56:12 +00:00
require 'spec_helper'
RSpec.describe ArchiveTraceWorker do
2018-01-29 16:56:12 +00:00
describe '#perform' do
subject { described_class.new.perform(job&.id) }
2018-01-29 16:56:12 +00:00
context 'when job is found' do
2018-11-29 05:51:03 +00:00
let(:job) { create(:ci_build, :trace_live) }
2018-01-29 16:56:12 +00:00
it 'executes service' do
2018-11-29 05:51:03 +00:00
expect_any_instance_of(Ci::ArchiveTraceService)
.to receive(:execute).with(job, anything)
2018-01-29 16:56:12 +00:00
subject
end
end
context 'when job is not found' do
let(:job) { nil }
it 'does not execute service' do
2018-11-29 05:51:03 +00:00
expect_any_instance_of(Ci::ArchiveTraceService)
.not_to receive(:execute)
2018-01-29 16:56:12 +00:00
subject
end
end
end
end