Ensure the right content is served for the build artifacts API

This commit is contained in:
Robert Schilling 2017-02-05 10:57:14 +01:00
parent 6e1d675de9
commit f5de8f159e
2 changed files with 6 additions and 0 deletions

View File

@ -188,6 +188,7 @@ describe API::Builds, api: true do
it 'returns specific build artifacts' do
expect(response).to have_http_status(200)
expect(response.headers).to include(download_headers)
expect(response.body).to match_file(build.artifacts_file.file.file)
end
end

View File

@ -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