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
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/performance_monitoring/prometheus_panel_group_spec.rb')
-rw-r--r--spec/models/performance_monitoring/prometheus_panel_group_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/models/performance_monitoring/prometheus_panel_group_spec.rb b/spec/models/performance_monitoring/prometheus_panel_group_spec.rb
index 2447bb5df94..ecf7e13a9a3 100644
--- a/spec/models/performance_monitoring/prometheus_panel_group_spec.rb
+++ b/spec/models/performance_monitoring/prometheus_panel_group_spec.rb
@@ -30,9 +30,17 @@ describe PerformanceMonitoring::PrometheusPanelGroup do
end
describe 'validations' do
+ context 'json_content is not a hash' do
+ let(:json_content) { nil }
+
+ subject { described_class.from_json(json_content) }
+
+ it { expect { subject }.to raise_error(ActiveModel::ValidationError) }
+ end
+
context 'when group is missing' do
before do
- json_content['group'] = nil
+ json_content.delete('group')
end
subject { described_class.from_json(json_content) }