Commit 518bb82c authored by scardoso's avatar scardoso

Fix spec errors

- incorrect hash format
- ensure summary cache feature flag is false when
  spec checks the params given to initialize the
  finder object
parent 5f6888ca
...@@ -29,7 +29,7 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do ...@@ -29,7 +29,7 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do
expect(findings_fetcher).to receive(:new).with( expect(findings_fetcher).to receive(:new).with(
anything, anything,
params: hash_including('project_id' => [findings_project.id]) params: hash_including(project_id: [findings_project.id])
).and_return(fetcher_double) ).and_return(fetcher_double)
get findings_endpoint, headers: findings_headers get findings_endpoint, headers: findings_headers
...@@ -45,7 +45,7 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do ...@@ -45,7 +45,7 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do
expect(findings_fetcher).to receive(:new).with( expect(findings_fetcher).to receive(:new).with(
anything, anything,
params: hash_including('project_id' => [findings_project.id]) params: hash_including(project_id: [findings_project.id])
).and_return(fetcher_double) ).and_return(fetcher_double)
get findings_endpoint, headers: findings_headers, params: project_ids_param get findings_endpoint, headers: findings_headers, params: project_ids_param
...@@ -77,7 +77,7 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do ...@@ -77,7 +77,7 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do
expect(findings_fetcher).to receive(:new).with( expect(findings_fetcher).to receive(:new).with(
anything, anything,
params: hash_including('project_id' => [findings_project.id]) params: hash_including(project_id: [findings_project.id])
).and_return(fetcher_double) ).and_return(fetcher_double)
get findings_endpoint, headers: findings_headers, params: project_ids_param get findings_endpoint, headers: findings_headers, params: project_ids_param
...@@ -90,13 +90,14 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do ...@@ -90,13 +90,14 @@ shared_examples 'instance security dashboard vulnerability findings endpoint' do
let(:findings_user) { create(:auditor) } let(:findings_user) { create(:auditor) }
it 'fetches vulnerabilities for all given projects on their dashboard' do it 'fetches vulnerabilities for all given projects on their dashboard' do
stub_feature_flags(cache_vulnerability_summary: false)
unmembered_project = create(:project) unmembered_project = create(:project)
findings_user.security_dashboard_projects << unmembered_project findings_user.security_dashboard_projects << unmembered_project
project_ids_param = { project_id: [findings_project.id, unmembered_project.id] } project_ids_param = { project_id: [findings_project.id, unmembered_project.id] }
expect(findings_fetcher).to receive(:new).with( expect(findings_fetcher).to receive(:new).with(
anything, anything,
params: hash_including('project_id' => array_including(findings_project.id, unmembered_project.id)) params: hash_including(project_id: array_including(findings_project.id, unmembered_project.id))
).and_return(fetcher_double) ).and_return(fetcher_double)
get findings_endpoint, headers: findings_headers, params: project_ids_param get findings_endpoint, headers: findings_headers, params: project_ids_param
......
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