summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-05 10:13:46 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-13 13:35:18 +0200
commit4a6dee5f1818d3acc0029a3384ee856151ad3d16 (patch)
treee14fadd427b536a84f33a6a87bedc22792cbd1d8
parent01f37eb77bc5d0f260196a00041d6052241adb46 (diff)
downloadgitlab-ce-4a6dee5f1818d3acc0029a3384ee856151ad3d16.tar.gz
Optimize CI/CD build retry service specs
-rw-r--r--spec/services/ci/retry_build_service_spec.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb
index bbc3a8c79f5..fbb3213f42b 100644
--- a/spec/services/ci/retry_build_service_spec.rb
+++ b/spec/services/ci/retry_build_service_spec.rb
@@ -1,9 +1,10 @@
require 'spec_helper'
describe Ci::RetryBuildService do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
- let(:pipeline) { create(:ci_pipeline, project: project) }
+ set(:user) { create(:user) }
+ set(:project) { create(:project) }
+ set(:pipeline) { create(:ci_pipeline, project: project) }
+
let(:build) { create(:ci_build, pipeline: pipeline) }
let(:service) do
@@ -37,7 +38,7 @@ describe Ci::RetryBuildService do
:queued, :coverage, :tags, :allowed_to_fail, :on_tag,
:triggered, :trace, :teardown_environment,
description: 'my-job', stage: 'test', pipeline: pipeline,
- auto_canceled_by: create(:ci_empty_pipeline)) do |build|
+ auto_canceled_by: create(:ci_empty_pipeline, project: project)) do |build|
##
# TODO, workaround for FactoryGirl limitation when having both
# stage (text) and stage_id (integer) columns in the table.