Commit db104aaf authored by Kamil Trzciński's avatar Kamil Trzciński

Improve test for .with_needs

parent 1e7aafdc
...@@ -185,8 +185,9 @@ describe Ci::Build do ...@@ -185,8 +185,9 @@ describe Ci::Build do
describe '.with_needs' do describe '.with_needs' do
let!(:build) { create(:ci_build) } let!(:build) { create(:ci_build) }
let!(:build_b) { create(:ci_build) }
let!(:build_need_a) { create(:ci_build_need, build: 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 context 'when passing build name' do
subject { described_class.with_needs(build_need_a.name) } subject { described_class.with_needs(build_need_a.name) }
...@@ -197,7 +198,7 @@ describe Ci::Build do ...@@ -197,7 +198,7 @@ describe Ci::Build do
context 'when not passing any build name' do context 'when not passing any build name' do
subject { described_class.with_needs } subject { described_class.with_needs }
it { is_expected.to contain_exactly(build) } it { is_expected.to contain_exactly(build, build_b) }
end end
context 'when not matching build name' do context 'when not matching build name' do
......
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