From 8ad92b95c92c6263d051c9f3045c9c2ad7e28f07 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 21 Jul 2016 00:13:02 +0800 Subject: [PATCH] Just put setup directly in the test, feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347#note_13202462 --- spec/models/project_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index c25c971c606..76dc70ae893 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1133,19 +1133,17 @@ describe Project, models: true do let(:pipeline) { create_pipeline } context 'with many builds' do - before do + it 'gives the latest builds from latest pipeline' do pipeline1 = create_pipeline pipeline2 = create_pipeline - @build1_p2 = create_build(pipeline2, 'test') + build1_p2 = create_build(pipeline2, 'test') create_build(pipeline1, 'test') create_build(pipeline1, 'test2') - @build2_p2 = create_build(pipeline2, 'test2') - end + build2_p2 = create_build(pipeline2, 'test2') - it 'gives the latest builds from latest pipeline' do 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