Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-24 06:09:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-24 06:09:38 +0300
commit3ff77f7f70cea745600379a6d434b3aafa12de01 (patch)
tree00898538e0459f2d0c20dbba722a5868f9294f5c /spec
parentcbb3bdad0677b0d7f6bf51b26be56a1bd049d0b1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/config/mail_room_spec.rb2
-rw-r--r--spec/initializers/secret_token_spec.rb4
-rw-r--r--spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb6
3 files changed, 6 insertions, 6 deletions
diff --git a/spec/config/mail_room_spec.rb b/spec/config/mail_room_spec.rb
index 6265b54931a..ce514bd8905 100644
--- a/spec/config/mail_room_spec.rb
+++ b/spec/config/mail_room_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe 'mail_room.yml' do
status = result.status
raise "Error interpreting #{mailroom_config_path}: #{output}" unless status == 0
- YAML.load(output)
+ YAML.safe_load(output, permitted_classes: [Symbol])
end
before do
diff --git a/spec/initializers/secret_token_spec.rb b/spec/initializers/secret_token_spec.rb
index ab16dbad3fc..2c396a18361 100644
--- a/spec/initializers/secret_token_spec.rb
+++ b/spec/initializers/secret_token_spec.rb
@@ -84,7 +84,7 @@ RSpec.describe 'create_tokens' do
it 'writes the secrets to secrets.yml' do
expect(File).to receive(:write).with('config/secrets.yml', any_args) do |filename, contents, options|
- new_secrets = YAML.load(contents)[Rails.env]
+ new_secrets = YAML.safe_load(contents)[Rails.env]
expect(new_secrets['secret_key_base']).to eq(secrets.secret_key_base)
expect(new_secrets['otp_key_base']).to eq(secrets.otp_key_base)
@@ -179,7 +179,7 @@ RSpec.describe 'create_tokens' do
it 'uses the file secret' do
expect(File).to receive(:write) do |filename, contents, options|
- new_secrets = YAML.load(contents)[Rails.env]
+ new_secrets = YAML.safe_load(contents)[Rails.env]
expect(new_secrets['secret_key_base']).to eq('file_key')
expect(new_secrets['otp_key_base']).to eq('file_key')
diff --git a/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb b/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb
index 3c7496cabd0..559557f9313 100644
--- a/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb
+++ b/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb
@@ -35,7 +35,7 @@ RSpec.describe Gitlab::Prometheus::AdditionalMetricsParser do
end
before do
- allow(described_class).to receive(:load_yaml_file) { YAML.load(sample_yaml) }
+ allow(described_class).to receive(:load_yaml_file) { YAML.safe_load(sample_yaml) }
end
it 'parses to two metric groups with 2 and 1 metric respectively' do
@@ -71,7 +71,7 @@ RSpec.describe Gitlab::Prometheus::AdditionalMetricsParser do
shared_examples 'required field' do |field_name|
context "when #{field_name} is nil" do
before do
- allow(described_class).to receive(:load_yaml_file) { YAML.load(field_missing) }
+ allow(described_class).to receive(:load_yaml_file) { YAML.safe_load(field_missing) }
end
it 'throws parsing error' do
@@ -81,7 +81,7 @@ RSpec.describe Gitlab::Prometheus::AdditionalMetricsParser do
context "when #{field_name} are not specified" do
before do
- allow(described_class).to receive(:load_yaml_file) { YAML.load(field_nil) }
+ allow(described_class).to receive(:load_yaml_file) { YAML.safe_load(field_nil) }
end
it 'throws parsing error' do