Commit 28ba89dd authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Rename vulnerability_statistic factory traits

parent 26d099cb
......@@ -4,24 +4,24 @@ FactoryBot.define do
factory :vulnerability_statistic, class: 'Vulnerabilities::Statistic' do
project
trait :a do
trait :grade_a do
info { 1 }
end
trait :b do
trait :grade_b do
low { 1 }
end
trait :c do
trait :grade_c do
medium { 1 }
end
trait :d do
trait :grade_d do
high { 1 }
unknown { 1 }
end
trait :f do
trait :grade_f do
critical { 1 }
end
end
......
......@@ -10,11 +10,11 @@ RSpec.describe Vulnerabilities::ProjectsGrade do
let_it_be(:project_4) { create(:project, group: group) }
let_it_be(:project_5) { create(:project, group: group) }
let_it_be(:vulnerability_statistic_1) { create(:vulnerability_statistic, :a, project: project_1) }
let_it_be(:vulnerability_statistic_2) { create(:vulnerability_statistic, :b, project: project_2) }
let_it_be(:vulnerability_statistic_3) { create(:vulnerability_statistic, :b, project: project_3) }
let_it_be(:vulnerability_statistic_4) { create(:vulnerability_statistic, :c, project: project_4) }
let_it_be(:vulnerability_statistic_5) { create(:vulnerability_statistic, :f, project: project_5) }
let_it_be(:vulnerability_statistic_1) { create(:vulnerability_statistic, :grade_a, project: project_1) }
let_it_be(:vulnerability_statistic_2) { create(:vulnerability_statistic, :grade_b, project: project_2) }
let_it_be(:vulnerability_statistic_3) { create(:vulnerability_statistic, :grade_b, project: project_3) }
let_it_be(:vulnerability_statistic_4) { create(:vulnerability_statistic, :grade_c, project: project_4) }
let_it_be(:vulnerability_statistic_5) { create(:vulnerability_statistic, :grade_f, project: project_5) }
describe '.grades_for' do
let(:compare_key) { ->(projects_grade) { [projects_grade.grade, projects_grade.project_ids.sort] } }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Query.project(fullPath).vulnerabilitySeveritiesCount' do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:statistic) { create(:vulnerability_statistic, :d, project: project) }
let_it_be(:statistic) { create(:vulnerability_statistic, :grade_d, project: project) }
let_it_be(:query) 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