Commit 2bc6111f authored by James Lopez's avatar James Lopez

Merge branch 'sh-fix-vulnerabilities-api-spec' into 'master'

Fix vulnerabilities API spec

Closes #11411

See merge request gitlab-org/gitlab-ee!12017
parents ae40c60d c0bd9c1d
...@@ -26,19 +26,17 @@ describe API::Vulnerabilities do ...@@ -26,19 +26,17 @@ describe API::Vulnerabilities do
end end
it 'returns all vulnerabilities' do it 'returns all vulnerabilities' do
get api("/projects/#{project.id}/vulnerabilities", user) get api("/projects/#{project.id}/vulnerabilities?per_page=40", user)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(response).to match_response_schema('vulnerabilities/occurrence_list', dir: 'ee') expect(response).to match_response_schema('vulnerabilities/occurrence_list', dir: 'ee')
expect(response.headers['X-Total']).to eq('37') expect(response.headers['X-Total']).to eq('37')
expect(response.headers['X-Total-Pages']).to eql('2') expect(response.headers['X-Total-Pages']).to eql('1')
expect(json_response.count).to eq 20 expect(json_response.count).to eq 37
expect(json_response.map { |v| v['report_type'] }.uniq).to match_array %w[dependency_scanning sast] expect(json_response.map { |v| v['report_type'] }.uniq).to match_array %w[dependency_scanning sast]
expect(json_response.first['name']).to eq 'DoS by CPU exhaustion when using malicious SSL packets'
end end
describe 'filtering' do describe 'filtering' 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