diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-12 06:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-12 06:09:13 +0300 |
commit | 08c975cb5d563f887d55e2fda91ec7803ae6fc4f (patch) | |
tree | 32119824169928a64f3119a7d1375e7d5286a0fc /spec | |
parent | 2aa98751c91f4d34feeb8be65d3c35e90f000882 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
4 files changed, 20 insertions, 35 deletions
diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index 7a8c6464acc..f2c4068f048 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -125,8 +125,8 @@ RSpec.describe GitlabSchema.types['Project'] do it "returns the project's sast configuration for analyzer variables" do analyzer = subject.dig('data', 'project', 'sastCiConfiguration', 'analyzers', 'nodes').first - expect(analyzer['name']).to eq('brakeman') - expect(analyzer['label']).to eq('Brakeman') + expect(analyzer['name']).to eq('bandit') + expect(analyzer['label']).to eq('Bandit') expect(analyzer['enabled']).to eq(true) end diff --git a/spec/lib/bulk_imports/common/transformers/user_reference_transformer_spec.rb b/spec/lib/bulk_imports/common/transformers/user_reference_transformer_spec.rb index e86a584d38a..ba74c173794 100644 --- a/spec/lib/bulk_imports/common/transformers/user_reference_transformer_spec.rb +++ b/spec/lib/bulk_imports/common/transformers/user_reference_transformer_spec.rb @@ -52,19 +52,26 @@ RSpec.describe BulkImports::Common::Transformers::UserReferenceTransformer do end context 'when custom reference is provided' do - it 'updates provided reference' do - hash = { - 'author' => { - 'public_email' => user.email + shared_examples 'updates provided reference' do |reference| + let(:hash) do + { + 'author' => { + 'public_email' => user.email + } } - } + end - transformer = described_class.new(reference: 'author') - result = transformer.transform(context, hash) + it 'updates provided reference' do + transformer = described_class.new(reference: reference) + result = transformer.transform(context, hash) - expect(result['author']).to be_nil - expect(result['author_id']).to eq(user.id) + expect(result['author']).to be_nil + expect(result['author_id']).to eq(user.id) + end end + + include_examples 'updates provided reference', 'author' + include_examples 'updates provided reference', :author end end end diff --git a/spec/serializers/build_artifact_entity_spec.rb b/spec/serializers/build_artifact_entity_spec.rb index 3d4dc3f69c9..8835d4d834e 100644 --- a/spec/serializers/build_artifact_entity_spec.rb +++ b/spec/serializers/build_artifact_entity_spec.rb @@ -27,28 +27,6 @@ RSpec.describe BuildArtifactEntity do expect(subject[:path]).to include "jobs/#{job.id}/artifacts/download?file_type=codequality" end - context 'with remove_duplicate_artifact_exposure_paths enabled' do - before do - stub_feature_flags(remove_duplicate_artifact_exposure_paths: true) - end - - it 'has no keep or browse path' do - expect(subject).not_to include(:keep_path) - expect(subject).not_to include(:browse_path) - end - end - - context 'with remove_duplicate_artifact_exposure_paths disabled' do - before do - stub_feature_flags(remove_duplicate_artifact_exposure_paths: false) - end - - it 'has keep and browse paths' do - expect(subject[:keep_path]).to be_present - expect(subject[:browse_path]).to be_present - end - end - context 'when project is specified in options' do let(:options) { super().merge(project: job.project) } diff --git a/spec/services/security/ci_configuration/sast_parser_service_spec.rb b/spec/services/security/ci_configuration/sast_parser_service_spec.rb index 21490f993c7..4ebaddcfa4e 100644 --- a/spec/services/security/ci_configuration/sast_parser_service_spec.rb +++ b/spec/services/security/ci_configuration/sast_parser_service_spec.rb @@ -12,8 +12,8 @@ RSpec.describe Security::CiConfiguration::SastParserService do let(:sast_analyzer_image_tag) { configuration['global'][2] } let(:sast_pipeline_stage) { configuration['pipeline'][0] } let(:sast_search_max_depth) { configuration['pipeline'][1] } - let(:brakeman) { configuration['analyzers'][0] } - let(:bandit) { configuration['analyzers'][1] } + let(:bandit) { configuration['analyzers'][0] } + let(:brakeman) { configuration['analyzers'][1] } let(:sast_brakeman_level) { brakeman['variables'][0] } it 'parses the configuration for SAST' do |