summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-02 12:20:34 +0000
committerSean McGivern <sean@gitlab.com>2019-08-02 12:20:34 +0000
commitcdd0272e653aab69a782f1e7466c0f11137e0c57 (patch)
tree21d7a2b18a7d92bae07219336d976b7dce6ba52b
parent2db7436aade588f77cf1a22461b7f70c9afaf4d8 (diff)
parentdb104aaf9236050ea5fd921efab664892a6b1880 (diff)
downloadgitlab-ce-cdd0272e653aab69a782f1e7466c0f11137e0c57.tar.gz
Merge branch 'improve-dag-tests' into 'master'
Improve test for .with_needs See merge request gitlab-org/gitlab-ce!31411
-rw-r--r--spec/models/ci/build_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 9369f393b5e..8768e914284 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -185,8 +185,9 @@ describe Ci::Build do
describe '.with_needs' do
let!(:build) { create(:ci_build) }
+ let!(:build_b) { create(:ci_build) }
let!(:build_need_a) { create(:ci_build_need, build: build) }
- let!(:build_need_b) { create(:ci_build_need, build: build) }
+ let!(:build_need_b) { create(:ci_build_need, build: build_b) }
context 'when passing build name' do
subject { described_class.with_needs(build_need_a.name) }
@@ -197,7 +198,7 @@ describe Ci::Build do
context 'when not passing any build name' do
subject { described_class.with_needs }
- it { is_expected.to contain_exactly(build) }
+ it { is_expected.to contain_exactly(build, build_b) }
end
context 'when not matching build name' do