Commit 26d099cb authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Remove unused `counts_by_severity` scope

parent 238356ad
......@@ -68,7 +68,6 @@ class Vulnerability < ApplicationRecord
scope :with_severities, -> (severities) { where(severity: severities) }
scope :with_states, -> (states) { where(state: states) }
scope :with_scanners, -> (scanners) { joins(findings: :scanner).merge(Vulnerabilities::Scanner.with_external_id(scanners)) }
scope :counts_by_severity, -> { group(:severity).count }
class << self
def parent_class
......
......@@ -166,24 +166,6 @@ RSpec.describe Vulnerability do
end
end
describe '.counts_by_severity' do
before do
create_list(:vulnerability, 2, severity: :critical)
create_list(:vulnerability, 3, severity: :high)
create(:vulnerability, severity: :low)
end
subject { described_class.counts_by_severity }
it 'returns the count for each severity' do
is_expected.to eq({
'critical' => 2,
'high' => 3,
'low' => 1
})
end
end
describe '.counts_by_day_and_severity' do
context 'when the vulnerability_history feature flag is disabled' do
before 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