summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2017-03-16 05:18:37 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-03-20 09:40:36 +0100
commit9267a9b19d6c7e090c286e9d922c71fe64190a47 (patch)
treef51fca2645c5fcd5b92b0104df54436137cb3ac5 /spec/requests
parente79ab1115bf6ab4776678a379f7d507455d867c0 (diff)
downloadgitlab-ce-9267a9b19d6c7e090c286e9d922c71fe64190a47.tar.gz
Send token of depenent job
Artifacts download for authorization is using a job token of job to which the artifact belongs. In APIv1 the token was sent with dependent jobs details and in APIv4 it was designed to also contain it. However I forgot about this parameter while working on `/api/v4/jobs/request` endpoint. This commit adds a missing parameter which is required for APIv4 to work properly.
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/runner_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index 65949fc195e..76461aabd9a 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -417,7 +417,8 @@ describe API::Runner do
end
context 'when project and pipeline have multiple jobs' do
- let!(:test_job) { create(:ci_build, pipeline: pipeline, name: 'deploy', stage: 'deploy', stage_idx: 1) }
+ let!(:job) { create(:ci_build_tag, pipeline: pipeline, token: 'job-token', name: 'spinach', stage: 'test', stage_idx: 0) }
+ let!(:test_job) { create(:ci_build, pipeline: pipeline, token: 'test-job-token', name: 'deploy', stage: 'deploy', stage_idx: 1) }
before { job.success }
@@ -427,7 +428,7 @@ describe API::Runner do
expect(response).to have_http_status(201)
expect(json_response['id']).to eq(test_job.id)
expect(json_response['dependencies'].count).to eq(1)
- expect(json_response['dependencies'][0]).to include('id' => job.id, 'name' => 'spinach')
+ expect(json_response['dependencies'][0]).to include('id' => job.id, 'name' => 'spinach', 'token' => job.token)
end
end