summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorsyasonik <syasonik@gitlab.com>2019-04-25 14:00:51 +0800
committersyasonik <syasonik@gitlab.com>2019-04-25 14:00:51 +0800
commit8926b37d5b0c48b9ef89e4769e622563a9b11e9f (patch)
tree8cd60768669a5a8d277356cb77a021aaae9da86a /spec
parent4a5c48c47cccd8ce2b6bd6912ecff925122778f0 (diff)
downloadgitlab-ce-8926b37d5b0c48b9ef89e4769e622563a9b11e9f.tar.gz
Prefer safe_load and deep_symbolize_keys
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects/environments_controller_spec.rb2
-rw-r--r--spec/lib/gitlab/metrics/dashboard/service_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/controllers/projects/environments_controller_spec.rb b/spec/controllers/projects/environments_controller_spec.rb
index b43698a6ef7..c1c4be45168 100644
--- a/spec/controllers/projects/environments_controller_spec.rb
+++ b/spec/controllers/projects/environments_controller_spec.rb
@@ -485,7 +485,7 @@ describe Projects::EnvironmentsController do
context 'when the dashboard could not be provided' do
before do
- allow(YAML).to receive(:load_file).and_return({})
+ allow(YAML).to receive(:safe_load).and_return({})
end
it 'returns an error response' do
diff --git a/spec/lib/gitlab/metrics/dashboard/service_spec.rb b/spec/lib/gitlab/metrics/dashboard/service_spec.rb
index 3f82fd7ebf8..e66c356bf49 100644
--- a/spec/lib/gitlab/metrics/dashboard/service_spec.rb
+++ b/spec/lib/gitlab/metrics/dashboard/service_spec.rb
@@ -19,7 +19,7 @@ describe Gitlab::Metrics::Dashboard::Service, :use_clean_rails_memory_store_cach
end
it 'caches the dashboard for subsequent calls' do
- expect(YAML).to receive(:load_file).once.and_call_original
+ expect(YAML).to receive(:safe_load).once.and_call_original
described_class.new(project, environment).get_dashboard
described_class.new(project, environment).get_dashboard
@@ -27,7 +27,7 @@ describe Gitlab::Metrics::Dashboard::Service, :use_clean_rails_memory_store_cach
context 'when the dashboard is configured incorrectly' do
before do
- allow(YAML).to receive(:load_file).and_return({})
+ allow(YAML).to receive(:safe_load).and_return({})
end
it 'returns an appropriate message and status code' do