summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-30 12:22:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-30 12:22:09 +0000
commiteba52140851d2fb08665119c0a3997d0612ccb88 (patch)
tree4bc562fadc518009435642e0bd265c8fb5bdc5a5 /spec/models
parent2da7c8579601c14a93d4291b8cf5fa39c6eeabd8 (diff)
downloadgitlab-ce-eba52140851d2fb08665119c0a3997d0612ccb88.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-2-stable-ee
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/design_management/design_spec.rb14
-rw-r--r--spec/models/integrations/datadog_spec.rb12
2 files changed, 6 insertions, 20 deletions
diff --git a/spec/models/design_management/design_spec.rb b/spec/models/design_management/design_spec.rb
index f2ce5e42eaf..b0601ea3f08 100644
--- a/spec/models/design_management/design_spec.rb
+++ b/spec/models/design_management/design_spec.rb
@@ -572,6 +572,12 @@ RSpec.describe DesignManagement::Design do
expect(described_class.link_reference_pattern).not_to match(url_for_designs(issue))
end
+ it 'intentionally ignores filenames with any special character' do
+ design = build(:design, issue: issue, filename: '"invalid')
+
+ expect(described_class.link_reference_pattern).not_to match(url_for_design(design))
+ end
+
where(:ext) do
(described_class::SAFE_IMAGE_EXT + described_class::DANGEROUS_IMAGE_EXT).flat_map do |ext|
[[ext], [ext.upcase]]
@@ -593,14 +599,6 @@ RSpec.describe DesignManagement::Design do
)
end
- context 'the file needs to be encoded' do
- let(:filename) { "my file.#{ext}" }
-
- it 'extracts the encoded filename' do
- expect(captures).to include('url_filename' => 'my%20file.' + ext)
- end
- end
-
context 'the file is all upper case' do
let(:filename) { "file.#{ext}".upcase }
diff --git a/spec/models/integrations/datadog_spec.rb b/spec/models/integrations/datadog_spec.rb
index 677bd4c5e48..7049e64c2ce 100644
--- a/spec/models/integrations/datadog_spec.rb
+++ b/spec/models/integrations/datadog_spec.rb
@@ -127,18 +127,6 @@ RSpec.describe Integrations::Datadog do
end
end
- describe '#api_keys_url' do
- subject { instance.api_keys_url }
-
- it { is_expected.to eq("https://app.#{dd_site}/account/settings#api") }
-
- context 'with unset datadog_site' do
- let(:dd_site) { '' }
-
- it { is_expected.to eq("https://docs.datadoghq.com/account_management/api-app-keys/") }
- end
- end
-
describe '#test' do
subject(:result) { saved_instance.test(pipeline_data) }