Merge branch 'api-fix-files' into 'master'
API: Fix file downloading See merge request !8953
This commit is contained in:
commit
da359c46b5
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: 'API: Fix file downloading'
|
||||||
|
merge_request: Robert Schilling
|
||||||
|
author: 8267
|
|
@ -304,7 +304,7 @@ module API
|
||||||
header['X-Sendfile'] = path
|
header['X-Sendfile'] = path
|
||||||
body
|
body
|
||||||
else
|
else
|
||||||
path
|
file path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,7 @@ describe API::Builds, api: true do
|
||||||
it 'returns specific job artifacts' do
|
it 'returns specific job artifacts' do
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers).to include(download_headers)
|
expect(response.headers).to include(download_headers)
|
||||||
|
expect(response.body).to match_file(build.artifacts_file.file.file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
RSpec::Matchers.define :match_file do |expected|
|
||||||
|
match do |actual|
|
||||||
|
expect(Digest::MD5.hexdigest(actual)).to eq(Digest::MD5.hexdigest(File.read(expected)))
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue