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