2018-01-29 11:56:12 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-03-06 07:40:50 -05:00
|
|
|
describe ArchiveTraceWorker do
|
2018-01-29 11:56:12 -05:00
|
|
|
describe '#perform' do
|
2018-01-31 09:48:48 -05:00
|
|
|
subject { described_class.new.perform(job&.id) }
|
2018-01-29 11:56:12 -05:00
|
|
|
|
|
|
|
context 'when job is found' do
|
|
|
|
let(:job) { create(:ci_build) }
|
|
|
|
|
|
|
|
it 'executes service' do
|
2018-02-28 04:48:08 -05:00
|
|
|
expect_any_instance_of(Gitlab::Ci::Trace).to receive(:archive!)
|
2018-01-29 11:56:12 -05:00
|
|
|
|
|
|
|
subject
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when job is not found' do
|
|
|
|
let(:job) { nil }
|
|
|
|
|
|
|
|
it 'does not execute service' do
|
2018-02-28 04:48:08 -05:00
|
|
|
expect_any_instance_of(Gitlab::Ci::Trace).not_to receive(:archive!)
|
2018-01-29 11:56:12 -05:00
|
|
|
|
|
|
|
subject
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|