Improve helpers in pipeline model specs

This commit is contained in:
Grzegorz Bizon 2017-04-21 19:49:18 +02:00
parent 3fdba5c96b
commit c3a6218193

View file

@ -328,7 +328,7 @@ describe Ci::Pipeline, models: true do
context 'when pipeline becomes blocked' do
let!(:build) { create_build('build:1') }
let!(:action) { create(:ci_build, :manual, pipeline: pipeline) }
let!(:action) { create_build('manual:action', :manual) }
before do
travel_to(current + 1.minute) do
@ -407,8 +407,8 @@ describe Ci::Pipeline, models: true do
end
end
def create_build(name, queued_at: current, started_from: 0, **opts)
create(:ci_build,
def create_build(name, *traits, queued_at: current, started_from: 0, **opts)
create(:ci_build, *traits,
name: name,
pipeline: pipeline,
queued_at: queued_at,