summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-30 06:09:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-30 06:09:06 +0000
commite6f10cb4b38644d88a2e0016af206d2eb68a25d8 (patch)
treeda8d9a962738ac64153cb42c5c518ac7080ed56d /spec
parenteddf35996244adeeac6edff5df82efe2167dff9c (diff)
downloadgitlab-ce-e6f10cb4b38644d88a2e0016af206d2eb68a25d8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/storage_helper_spec.rb6
-rw-r--r--spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb10
-rw-r--r--spec/lib/gitlab/regex_spec.rb14
-rw-r--r--spec/models/x509_certificate_spec.rb5
-rw-r--r--spec/models/x509_issuer_spec.rb5
5 files changed, 36 insertions, 4 deletions
diff --git a/spec/helpers/storage_helper_spec.rb b/spec/helpers/storage_helper_spec.rb
index 4732076ab13..cd5701db83b 100644
--- a/spec/helpers/storage_helper_spec.rb
+++ b/spec/helpers/storage_helper_spec.rb
@@ -89,6 +89,12 @@ RSpec.describe StorageHelper do
expect(helper.storage_enforcement_banner_info(free_group)).to be(nil)
end
+ it 'returns nil when namespace_storage_limit_show_preenforcement_banner FF is disabled' do
+ stub_feature_flags(namespace_storage_limit_show_preenforcement_banner: false)
+
+ expect(helper.storage_enforcement_banner_info(free_group)).to be(nil)
+ end
+
context 'when current_user can access the usage quotas page' do
it 'returns a hash' do
expect(helper.storage_enforcement_banner_info(free_group)).to eql({
diff --git a/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
index 27de8324206..65fd2b016ac 100644
--- a/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
@@ -34,6 +34,16 @@ RSpec.describe 'Deploy-ECS.gitlab-ci.yml' do
expect(build_names).to include('production_ecs')
end
+ context 'when the DAST template is also included' do
+ let(:dast_template) { Gitlab::Template::GitlabCiYmlTemplate.find('Security/DAST') }
+
+ before do
+ stub_ci_pipeline_yaml_file(template.content + dast_template.content)
+ end
+
+ include_examples 'no pipeline yaml error'
+ end
+
context 'when running a pipeline for a branch' do
let(:pipeline_branch) { 'test_branch' }
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
index d48e8183650..a3afbed18e2 100644
--- a/spec/lib/gitlab/regex_spec.rb
+++ b/spec/lib/gitlab/regex_spec.rb
@@ -968,4 +968,18 @@ RSpec.describe Gitlab::Regex do
it { is_expected.not_to match('abc!abc') }
it { is_expected.not_to match((['abc'] * 100).join('.') + '!') }
end
+
+ describe '.x509_subject_key_identifier_regex' do
+ subject { described_class.x509_subject_key_identifier_regex }
+
+ it { is_expected.to match('AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB') }
+ it { is_expected.to match('CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD') }
+ it { is_expected.to match('79:FB:C1:E5:6B:53:8B:0A') }
+ it { is_expected.to match('79:fb:c1:e5:6b:53:8b:0a') }
+
+ it { is_expected.not_to match('') }
+ it { is_expected.not_to match('CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:GG') }
+ it { is_expected.not_to match('random string') }
+ it { is_expected.not_to match('12321342545356434523412341245452345623453542345234523453245') }
+ end
end
diff --git a/spec/models/x509_certificate_spec.rb b/spec/models/x509_certificate_spec.rb
index d3b4470d3f4..5723bd80739 100644
--- a/spec/models/x509_certificate_spec.rb
+++ b/spec/models/x509_certificate_spec.rb
@@ -73,7 +73,9 @@ RSpec.describe X509Certificate do
it 'accepts correct subject_key_identifier' do
subject_key_identifiers = [
'AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB',
- 'CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD'
+ 'CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD',
+ '79:FB:C1:E5:6B:53:8B:0A',
+ '79:fb:c1:e5:6b:53:8b:0a'
]
subject_key_identifiers.each do |identifier|
@@ -83,7 +85,6 @@ RSpec.describe X509Certificate do
it 'rejects invalid subject_key_identifier' do
subject_key_identifiers = [
- 'AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB',
'CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:GG',
'random string',
'12321342545356434523412341245452345623453542345234523453245'
diff --git a/spec/models/x509_issuer_spec.rb b/spec/models/x509_issuer_spec.rb
index f1067cad655..3d04adf7e26 100644
--- a/spec/models/x509_issuer_spec.rb
+++ b/spec/models/x509_issuer_spec.rb
@@ -39,7 +39,9 @@ RSpec.describe X509Issuer do
it 'accepts correct subject_key_identifier' do
subject_key_identifiers = [
'AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB',
- 'CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD'
+ 'CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD',
+ '79:FB:C1:E5:6B:53:8B:0A',
+ '79:fb:c1:e5:6b:53:8b:0a'
]
subject_key_identifiers.each do |identifier|
@@ -49,7 +51,6 @@ RSpec.describe X509Issuer do
it 'rejects invalid subject_key_identifier' do
subject_key_identifiers = [
- 'AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB',
'CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:CD:GG',
'random string',
'12321342545356434523412341245452345623453542345234523453245'