Commit 6f843457 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Improve build retry service tests for cloning data

parent dd9d8ce8
......@@ -80,6 +80,14 @@ FactoryGirl.define do
tag_list [:docker, :ruby]
end
trait :on_tag do
tag true
end
trait :triggered do
trigger_request factory: :ci_trigger_request_with_variables
end
after(:build) do |build, evaluator|
build.project = build.pipeline.project
end
......
......@@ -12,13 +12,16 @@ describe Ci::RetryBuildService, :services do
shared_examples 'build duplication' do
let(:build) do
create(:ci_build, :failed, :artifacts_expired, :erased, :trace,
:queued, :coverage, :tags, pipeline: pipeline)
create(:ci_build, :failed, :artifacts_expired, :erased,
:queued, :coverage, :tags, :allowed_to_fail, :on_tag,
:teardown_environment, :triggered, :trace,
description: 'some build', pipeline: pipeline)
end
describe 'clone attributes' do
described_class::CLONE_ACCESSORS.each do |attribute|
it "clones #{attribute} build attribute" do
expect(new_build.send(attribute)).to be_present
expect(new_build.send(attribute)).to eq build.send(attribute)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment