diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-07 00:19:24 +0300 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-07 00:19:24 +0300 |
commit | a85948862ebadb02dbe93d5ce74ba00f32d9a0c0 (patch) | |
tree | af57433842cdd896ed88c862d9eadcfed7fd3596 /spec/requests/api | |
parent | b03b31659b0101dc4a5838bec7dca193706661cd (diff) |
fix some broken specs
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/jobs_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/requests/api/jobs_spec.rb b/spec/requests/api/jobs_spec.rb index 983bef6cdd0..ae0c377682e 100644 --- a/spec/requests/api/jobs_spec.rb +++ b/spec/requests/api/jobs_spec.rb @@ -307,6 +307,19 @@ describe API::Jobs do end describe 'GET /projects/:id/jobs/:job_id/artifacts' do + shared_examples 'downloads artifact' do + let(:download_headers) do + { 'Content-Transfer-Encoding' => 'binary', + 'Content-Disposition' => 'attachment; filename=ci_build_artifacts.zip' } + end + + it 'returns specific job artifacts' do + expect(response).to have_gitlab_http_status(200) + expect(response.headers).to include(download_headers) + expect(response.body).to match_file(job.artifacts_file.file.file) + end + end + before do stub_artifacts_object_storage get api("/projects/#{project.id}/jobs/#{job.id}/artifacts", api_user) |