Commit f5de8f15 authored by Robert Schilling's avatar Robert Schilling

Ensure the right content is served for the build artifacts API

parent 6e1d675d
...@@ -188,6 +188,7 @@ describe API::Builds, api: true do ...@@ -188,6 +188,7 @@ describe API::Builds, api: true do
it 'returns specific build artifacts' do it 'returns specific build 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
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment