gitlab-org--gitlab-foss/spec/workers/build_process_worker_spec.rb
Kamil Trzciński e7ee84aad4 Add support for DAG
This implements the support for `needs:` keyword
as part of GitLab CI. That makes some of the jobs
to be run out of order.
2019-08-01 14:26:49 +00:00

26 lines
635 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe BuildProcessWorker do
describe '#perform' do
context 'when build exists' do
let(:pipeline) { create(:ci_pipeline) }
let(:build) { create(:ci_build, pipeline: pipeline) }
it 'processes build' do
expect_any_instance_of(Ci::Pipeline).to receive(:process!)
.with(build.name)
described_class.new.perform(build.id)
end
end
context 'when build does not exist' do
it 'does not raise exception' do
expect { described_class.new.perform(123) }
.not_to raise_error
end
end
end
end