diff options
Diffstat (limited to 'spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb')
-rw-r--r-- | spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb b/spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb index dd557c833f3..b514c92c52d 100644 --- a/spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb +++ b/spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb @@ -3,35 +3,35 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleDropInvalidVulnerabilities2, :migration do - let_it_be(:background_migration_jobs) { table(:background_migration_jobs) } +RSpec.describe ScheduleDropInvalidVulnerabilities2, :migration, feature_category: :value_stream_management do + let!(:background_migration_jobs) { table(:background_migration_jobs) } - let_it_be(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } - let_it_be(:users) { table(:users) } - let_it_be(:user) { create_user! } - let_it_be(:project) { table(:projects).create!(id: 123, namespace_id: namespace.id) } + let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } + let!(:users) { table(:users) } + let!(:user) { create_user! } + let!(:project) { table(:projects).create!(id: 123, namespace_id: namespace.id) } - let_it_be(:scanners) { table(:vulnerability_scanners) } - let_it_be(:scanner) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') } - let_it_be(:different_scanner) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') } + let!(:scanners) { table(:vulnerability_scanners) } + let!(:scanner) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') } + let!(:different_scanner) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') } - let_it_be(:vulnerabilities) { table(:vulnerabilities) } - let_it_be(:vulnerability_with_finding) do + let!(:vulnerabilities) { table(:vulnerabilities) } + let!(:vulnerability_with_finding) do create_vulnerability!( project_id: project.id, author_id: user.id ) end - let_it_be(:vulnerability_without_finding) do + let!(:vulnerability_without_finding) do create_vulnerability!( project_id: project.id, author_id: user.id ) end - let_it_be(:vulnerability_identifiers) { table(:vulnerability_identifiers) } - let_it_be(:primary_identifier) do + let!(:vulnerability_identifiers) { table(:vulnerability_identifiers) } + let!(:primary_identifier) do vulnerability_identifiers.create!( project_id: project.id, external_type: 'uuid-v5', @@ -40,8 +40,8 @@ RSpec.describe ScheduleDropInvalidVulnerabilities2, :migration do name: 'Identifier for UUIDv5') end - let_it_be(:vulnerabilities_findings) { table(:vulnerability_occurrences) } - let_it_be(:finding) do + let!(:vulnerabilities_findings) { table(:vulnerability_occurrences) } + let!(:finding) do create_finding!( vulnerability_id: vulnerability_with_finding.id, project_id: project.id, @@ -88,7 +88,7 @@ RSpec.describe ScheduleDropInvalidVulnerabilities2, :migration do vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:, name: "test", severity: 7, confidence: 7, report_type: 0, project_fingerprint: '123qweasdzxc', location_fingerprint: 'test', - metadata_version: 'test', raw_metadata: 'test', uuid: 'test') + metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid) vulnerabilities_findings.create!( vulnerability_id: vulnerability_id, project_id: project_id, |