summaryrefslogtreecommitdiff
path: root/spec/models/performance_monitoring/prometheus_metric_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/performance_monitoring/prometheus_metric_spec.rb')
-rw-r--r--spec/models/performance_monitoring/prometheus_metric_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/performance_monitoring/prometheus_metric_spec.rb b/spec/models/performance_monitoring/prometheus_metric_spec.rb
index 08288e5d993..83f687aa90e 100644
--- a/spec/models/performance_monitoring/prometheus_metric_spec.rb
+++ b/spec/models/performance_monitoring/prometheus_metric_spec.rb
@@ -24,6 +24,14 @@ describe PerformanceMonitoring::PrometheusMetric 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 unit is missing' do
before do
json_content['unit'] = nil