[Rails5] Fix `undefined method 'downcase'` errors in requests specs

Port of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18645
parent 0b429028
...@@ -282,7 +282,7 @@ describe API::Jobs do ...@@ -282,7 +282,7 @@ describe API::Jobs do
get_artifact_file(artifact) get_artifact_file(artifact)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.headers) expect(response.headers.to_h)
.to include('Content-Type' => 'application/json', .to include('Content-Type' => 'application/json',
'Gitlab-Workhorse-Send-Data' => /artifacts-entry/) 'Gitlab-Workhorse-Send-Data' => /artifacts-entry/)
end end
...@@ -312,7 +312,7 @@ describe API::Jobs do ...@@ -312,7 +312,7 @@ describe API::Jobs do
it 'returns specific job artifacts' do it 'returns specific job artifacts' do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.headers).to include(download_headers) expect(response.headers.to_h).to include(download_headers)
expect(response.body).to match_file(job.artifacts_file.file.file) expect(response.body).to match_file(job.artifacts_file.file.file)
end end
end end
...@@ -463,7 +463,7 @@ describe API::Jobs do ...@@ -463,7 +463,7 @@ describe API::Jobs do
end end
it { expect(response).to have_http_status(:ok) } it { expect(response).to have_http_status(:ok) }
it { expect(response.headers).to include(download_headers) } it { expect(response.headers.to_h).to include(download_headers) }
end end
context 'when artifacts are stored remotely' do context 'when artifacts are stored remotely' do
......
...@@ -1332,7 +1332,7 @@ describe API::Runner do ...@@ -1332,7 +1332,7 @@ describe API::Runner do
it 'download artifacts' do it 'download artifacts' do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.headers).to include download_headers expect(response.headers.to_h).to include download_headers
end end
end end
...@@ -1347,7 +1347,7 @@ describe API::Runner do ...@@ -1347,7 +1347,7 @@ describe API::Runner do
it 'uses workhorse send-url' do it 'uses workhorse send-url' do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.headers).to include( expect(response.headers.to_h).to include(
'Gitlab-Workhorse-Send-Data' => /send-url:/) 'Gitlab-Workhorse-Send-Data' => /send-url:/)
end end
end end
......
...@@ -232,7 +232,7 @@ describe API::V3::Builds do ...@@ -232,7 +232,7 @@ describe API::V3::Builds 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_h).to include(download_headers)
expect(response.body).to match_file(build.artifacts_file.file.file) expect(response.body).to match_file(build.artifacts_file.file.file)
end end
end end
...@@ -332,7 +332,7 @@ describe API::V3::Builds do ...@@ -332,7 +332,7 @@ describe API::V3::Builds do
end end
it { expect(response).to have_http_status(200) } it { expect(response).to have_http_status(200) }
it { expect(response.headers).to include(download_headers) } it { expect(response.headers.to_h).to include(download_headers) }
end end
context 'when artifacts are stored remotely' do context 'when artifacts are stored remotely' do
......
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