diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-06-29 18:07:09 +0200 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-06-29 18:07:09 +0200 |
commit | c8e20d6f8f9706e80ef943cccc8394f2ffaff37e (patch) | |
tree | 57d03c0b05809dd0e0bc29d01c0437a650c039a0 /spec/controllers/projects | |
parent | 7e5bbc0d1cd0eb9b052ab1f467cc52f5a13d6f93 (diff) | |
download | gitlab-ce-c8e20d6f8f9706e80ef943cccc8394f2ffaff37e.tar.gz |
Check for correct builds collection
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r-- | spec/controllers/projects/jobs_controller_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb index 06c8a432561..b10421b8f26 100644 --- a/spec/controllers/projects/jobs_controller_spec.rb +++ b/spec/controllers/projects/jobs_controller_spec.rb @@ -102,6 +102,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do describe 'GET show' do let!(:job) { create(:ci_build, :failed, pipeline: pipeline) } + let!(:second_job) { create(:ci_build, :failed, pipeline: pipeline) } + let!(:third_job) { create(:ci_build, :failed) } context 'when requesting HTML' do context 'when job exists' do @@ -113,6 +115,13 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do expect(response).to have_gitlab_http_status(:ok) expect(assigns(:build).id).to eq(job.id) end + + it 'has the correct build collection' do + builds = assigns(:builds).map(&:id) + + expect(builds).to include(job.id, second_job.id) + expect(builds).not_to include(third_job.id) + end end context 'when job does not exist' do |