From db104aaf9236050ea5fd921efab664892a6b1880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Thu, 1 Aug 2019 15:30:06 +0200 Subject: Improve test for .with_needs --- spec/models/ci/build_spec.rb | 5 +++-- 1 file 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 -- cgit v1.2.1