diff options
Diffstat (limited to 'spec/lib/security/ci_configuration/sast_build_action_spec.rb')
-rw-r--r-- | spec/lib/security/ci_configuration/sast_build_action_spec.rb | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/spec/lib/security/ci_configuration/sast_build_action_spec.rb b/spec/lib/security/ci_configuration/sast_build_action_spec.rb index efb8b0b9984..611a886d252 100644 --- a/spec/lib/security/ci_configuration/sast_build_action_spec.rb +++ b/spec/lib/security/ci_configuration/sast_build_action_spec.rb @@ -4,54 +4,54 @@ require 'spec_helper' RSpec.describe Security::CiConfiguration::SastBuildAction do let(:default_sast_values) do - { 'global' => + { global: [ - { 'field' => 'SECURE_ANALYZERS_PREFIX', 'defaultValue' => 'registry.gitlab.com/security-products', 'value' => 'registry.gitlab.com/security-products' } + { field: 'SECURE_ANALYZERS_PREFIX', default_value: 'registry.gitlab.com/security-products', value: 'registry.gitlab.com/security-products' } ], - 'pipeline' => + pipeline: [ - { 'field' => 'stage', 'defaultValue' => 'test', 'value' => 'test' }, - { 'field' => 'SEARCH_MAX_DEPTH', 'defaultValue' => 4, 'value' => 4 }, - { 'field' => 'SAST_EXCLUDED_PATHS', 'defaultValue' => 'spec, test, tests, tmp', 'value' => 'spec, test, tests, tmp' } + { field: 'stage', default_value: 'test', value: 'test' }, + { field: 'SEARCH_MAX_DEPTH', default_value: 4, value: 4 }, + { field: 'SAST_EXCLUDED_PATHS', default_value: 'spec, test, tests, tmp', value: 'spec, test, tests, tmp' } ] } end let(:params) do - { 'global' => + { global: [ - { 'field' => 'SECURE_ANALYZERS_PREFIX', 'defaultValue' => 'registry.gitlab.com/security-products', 'value' => 'new_registry' } + { field: 'SECURE_ANALYZERS_PREFIX', default_value: 'registry.gitlab.com/security-products', value: 'new_registry' } ], - 'pipeline' => + pipeline: [ - { 'field' => 'stage', 'defaultValue' => 'test', 'value' => 'security' }, - { 'field' => 'SEARCH_MAX_DEPTH', 'defaultValue' => 4, 'value' => 1 }, - { 'field' => 'SAST_EXCLUDED_PATHS', 'defaultValue' => 'spec, test, tests, tmp', 'value' => 'spec,docs' } + { field: 'stage', default_value: 'test', value: 'security' }, + { field: 'SEARCH_MAX_DEPTH', default_value: 4, value: 1 }, + { field: 'SAST_EXCLUDED_PATHS', default_value: 'spec, test, tests, tmp', value: 'spec,docs' } ] } end let(:params_with_analyzer_info) do - params.merge( { 'analyzers' => + params.merge( { analyzers: [ { - 'name' => "bandit", - 'enabled' => false + name: "bandit", + enabled: false }, { - 'name' => "brakeman", - 'enabled' => true, - 'variables' => [ - { 'field' => "SAST_BRAKEMAN_LEVEL", - 'defaultValue' => "1", - 'value' => "2" } + name: "brakeman", + enabled: true, + variables: [ + { field: "SAST_BRAKEMAN_LEVEL", + default_value: "1", + value: "2" } ] }, { - 'name' => "flawfinder", - 'enabled' => true, - 'variables' => [ - { 'field' => "SAST_FLAWFINDER_LEVEL", - 'defaultValue' => "1", - 'value' => "1" } + name: "flawfinder", + enabled: true, + variables: [ + { field: "SAST_FLAWFINDER_LEVEL", + default_value: "1", + value: "1" } ] } ] } @@ -59,15 +59,15 @@ RSpec.describe Security::CiConfiguration::SastBuildAction do end let(:params_with_all_analyzers_enabled) do - params.merge( { 'analyzers' => + params.merge( { analyzers: [ { - 'name' => "flawfinder", - 'enabled' => true + name: "flawfinder", + enabled: true }, { - 'name' => "brakeman", - 'enabled' => true + name: "brakeman", + enabled: true } ] } ) @@ -162,15 +162,15 @@ RSpec.describe Security::CiConfiguration::SastBuildAction do context 'with update stage and SEARCH_MAX_DEPTH and set SECURE_ANALYZERS_PREFIX to default' do let(:params) do - { 'global' => + { global: [ - { 'field' => 'SECURE_ANALYZERS_PREFIX', 'defaultValue' => 'registry.gitlab.com/security-products', 'value' => 'registry.gitlab.com/security-products' } + { field: 'SECURE_ANALYZERS_PREFIX', default_value: 'registry.gitlab.com/security-products', value: 'registry.gitlab.com/security-products' } ], - 'pipeline' => + pipeline: [ - { 'field' => 'stage', 'defaultValue' => 'test', 'value' => 'brand_new_stage' }, - { 'field' => 'SEARCH_MAX_DEPTH', 'defaultValue' => 4, 'value' => 5 }, - { 'field' => 'SAST_EXCLUDED_PATHS', 'defaultValue' => 'spec, test, tests, tmp', 'value' => 'spec,docs' } + { field: 'stage', default_value: 'test', value: 'brand_new_stage' }, + { field: 'SEARCH_MAX_DEPTH', default_value: 4, value: 5 }, + { field: 'SAST_EXCLUDED_PATHS', default_value: 'spec, test, tests, tmp', value: 'spec,docs' } ] } end @@ -273,9 +273,9 @@ RSpec.describe Security::CiConfiguration::SastBuildAction do context 'with one empty parameter' do let(:params) do - { 'global' => + { global: [ - { 'field' => 'SECURE_ANALYZERS_PREFIX', 'defaultValue' => 'registry.gitlab.com/security-products', 'value' => '' } + { field: 'SECURE_ANALYZERS_PREFIX', default_value: 'registry.gitlab.com/security-products', value: '' } ] } end |