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

28 lines
570 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
require 'spec_helper'
2018-03-27 19:54:05 +05:30
describe ArchiveTraceWorker do
2018-03-17 18:26:18 +05:30
describe '#perform' do
subject { described_class.new.perform(job&.id) }
context 'when job is found' do
let(:job) { create(:ci_build) }
it 'executes service' do
2018-03-27 19:54:05 +05:30
expect_any_instance_of(Gitlab::Ci::Trace).to receive(:archive!)
2018-03-17 18:26:18 +05:30
subject
end
end
context 'when job is not found' do
let(:job) { nil }
it 'does not execute service' do
2018-03-27 19:54:05 +05:30
expect_any_instance_of(Gitlab::Ci::Trace).not_to receive(:archive!)
2018-03-17 18:26:18 +05:30
subject
end
end
end
end