diff options
Diffstat (limited to 'spec/migrations/reset_severity_levels_to_new_default_spec.rb')
-rw-r--r-- | spec/migrations/reset_severity_levels_to_new_default_spec.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/spec/migrations/reset_severity_levels_to_new_default_spec.rb b/spec/migrations/reset_severity_levels_to_new_default_spec.rb deleted file mode 100644 index 83e57b852a0..00000000000 --- a/spec/migrations/reset_severity_levels_to_new_default_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe ResetSeverityLevelsToNewDefault, feature_category: :source_code_management do - let(:approval_project_rules) { table(:approval_project_rules) } - let(:projects) { table(:projects) } - let(:namespaces) { table(:namespaces) } - let(:namespace) { namespaces.create!(name: 'namespace', path: 'namespace') } - let(:project) { projects.create!(name: 'project', path: 'project', namespace_id: namespace.id) } - let(:approval_project_rule) { approval_project_rules.create!(name: 'rule', project_id: project.id, severity_levels: severity_levels) } - - context 'without having all severity levels selected' do - let(:severity_levels) { ['high'] } - - it 'does not change severity_levels' do - expect(approval_project_rule.severity_levels).to eq(severity_levels) - expect { migrate! }.not_to change { approval_project_rule.reload.severity_levels } - end - end - - context 'with all scanners selected' do - let(:severity_levels) { ::Enums::Vulnerability::SEVERITY_LEVELS.keys } - let(:default_levels) { %w(unknown high critical) } - - it 'changes severity_levels to the default value' do - expect(approval_project_rule.severity_levels).to eq(severity_levels) - expect { migrate! }.to change { approval_project_rule.reload.severity_levels }.from(severity_levels).to(default_levels) - end - end -end |