BigW Consortium Gitlab

Commit 8ad92b95 by Lin Jen-Shin

Just put setup directly in the test, feedback:

parent ba962aa3
...@@ -1133,19 +1133,17 @@ describe Project, models: true do ...@@ -1133,19 +1133,17 @@ describe Project, models: true do
let(:pipeline) { create_pipeline } let(:pipeline) { create_pipeline }
context 'with many builds' do context 'with many builds' do
before do it 'gives the latest builds from latest pipeline' do
pipeline1 = create_pipeline pipeline1 = create_pipeline
pipeline2 = create_pipeline pipeline2 = create_pipeline
@build1_p2 = create_build(pipeline2, 'test') build1_p2 = create_build(pipeline2, 'test')
create_build(pipeline1, 'test') create_build(pipeline1, 'test')
create_build(pipeline1, 'test2') create_build(pipeline1, 'test2')
@build2_p2 = create_build(pipeline2, 'test2') build2_p2 = create_build(pipeline2, 'test2')
end
it 'gives the latest builds from latest pipeline' do
latest_builds = project.latest_successful_builds_for latest_builds = project.latest_successful_builds_for
expect(latest_builds).to contain_exactly(@build2_p2, @build1_p2) expect(latest_builds).to contain_exactly(build2_p2, build1_p2)
end end
end end
......
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