Commit b64b3886 authored by Avielle Wolfe's avatar Avielle Wolfe

Move mystery number to a constant

This allows us to more easily stub paginates_per in specs, as well as
clarifies a mystery number. (Not that it was too difficult to understand
before, but it's nicer now.)
parent 4e534abf
......@@ -8,7 +8,9 @@ module Vulnerabilities
self.table_name = "vulnerability_occurrences"
paginates_per 20
OCCURRENCES_PER_PAGE = 20
paginates_per OCCURRENCES_PER_PAGE
sha_attribute :project_fingerprint
sha_attribute :location_fingerprint
......
......@@ -46,9 +46,7 @@ shared_examples VulnerabilitiesActions do
let(:params) { vulnerable_params.merge(page: 2) }
before do
class Vulnerabilities::Occurrence
paginates_per 2
end
Vulnerabilities::Occurrence.paginates_per 2
create_list(:vulnerabilities_occurrence, 3, pipelines: [pipeline], project: project)
......@@ -56,9 +54,7 @@ shared_examples VulnerabilitiesActions do
end
after do
class Vulnerabilities::Occurrence
paginates_per 20
end
Vulnerabilities::Occurrence.paginates_per Vulnerabilities::Occurrence::OCCURRENCES_PER_PAGE
end
it 'returns the list of vulnerabilities that are on the requested page' 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