Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-04-05 15:07:12 +0300
committerJames Lopez <james@jameslopez.es>2017-04-10 09:58:32 +0300
commit894817fcc9046d03e2d3456b6a52b59e6facfecf (patch)
tree111750bf0013041b9c9f10a0037a3fa4bfb59566 /spec
parent183f2b9bc1bc00093a0ac6e5240b918adc8c3a6c (diff)
Merge branch 'gitlab-ci-multi-runner-2284' into 'master'
Return an empty array when dependencies is an empty array Closes #30316 and gitlab-ci-multi-runner#2284 See merge request !10359
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/runner_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index 044b989e5ba..1cfac7353d4 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -461,6 +461,29 @@ describe API::Runner do
end
end
+ context 'when dependencies is an empty array' do
+ let!(:job) { create(:ci_build_tag, pipeline: pipeline, name: 'spinach', stage: 'test', stage_idx: 0) }
+ let!(:job2) { create(:ci_build_tag, pipeline: pipeline, name: 'rubocop', stage: 'test', stage_idx: 0) }
+ let!(:empty_dependencies_job) do
+ create(:ci_build, pipeline: pipeline, token: 'test-job-token', name: 'empty_dependencies_job',
+ stage: 'deploy', stage_idx: 1,
+ options: { dependencies: [] })
+ end
+
+ before do
+ job.success
+ job2.success
+ end
+
+ it 'returns an empty array' do
+ request_job
+
+ expect(response).to have_http_status(201)
+ expect(json_response['id']).to eq(empty_dependencies_job.id)
+ expect(json_response['dependencies'].count).to eq(0)
+ end
+ end
+
context 'when job has no tags' do
before { job.update(tags: []) }