summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-05 10:09:22 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-13 13:35:18 +0200
commit01f37eb77bc5d0f260196a00041d6052241adb46 (patch)
tree97dd81706f2eadaf0504fb1d7654ba4d79374b51
parentd2e02224cb4b8b340631edf29aa842e386fc7f1e (diff)
downloadgitlab-ce-01f37eb77bc5d0f260196a00041d6052241adb46.tar.gz
Optimize CI/CD build model specs
-rw-r--r--spec/models/ci/build_spec.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index c2c9f1c12d1..c608583c6d4 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -1,18 +1,18 @@
require 'spec_helper'
describe Ci::Build do
- let(:user) { create(:user) }
- let(:project) { create(:project, :repository) }
- let(:build) { create(:ci_build, pipeline: pipeline) }
- let(:test_trace) { 'This is a test' }
+ set(:user) { create(:user) }
+ set(:project) { create(:project, :repository) }
- let(:pipeline) do
+ set(:pipeline) do
create(:ci_pipeline, project: project,
sha: project.commit.id,
ref: project.default_branch,
status: 'success')
end
+ let(:build) { create(:ci_build, pipeline: pipeline) }
+
it { is_expected.to belong_to(:runner) }
it { is_expected.to belong_to(:trigger_request) }
it { is_expected.to belong_to(:erased_by) }
@@ -1096,9 +1096,6 @@ describe Ci::Build do
end
describe '#repo_url' do
- let(:build) { create(:ci_build) }
- let(:project) { build.project }
-
subject { build.repo_url }
it { is_expected.to be_a(String) }