summaryrefslogtreecommitdiff
path: root/spec/support/helpers
diff options
context:
space:
mode:
authorSarah Yasonik <syasonik@gitlab.com>2019-06-20 14:06:18 +0000
committerSean McGivern <sean@gitlab.com>2019-06-20 14:06:18 +0000
commitf49dd76a44ec04d35fbf3f08bd3c950d2df4de5b (patch)
tree43c53421eeb64cac700969cc0ec3a3871e5a03ee /spec/support/helpers
parent429f6b629b691945d8cd187b79e00cfa7eed6fa2 (diff)
downloadgitlab-ce-f49dd76a44ec04d35fbf3f08bd3c950d2df4de5b.tar.gz
Add embedding flag and filter to CPU/Mem
This commits adds support for metrics dashboards for embedding. If the flag 'embedded' is provided to the environments/id/metrics_dashboard endpoint, the response will be suitable for embedding in issues or other content. This is a precursor for support for embedding metrics in GFM.
Diffstat (limited to 'spec/support/helpers')
-rw-r--r--spec/support/helpers/metrics_dashboard_helpers.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/support/helpers/metrics_dashboard_helpers.rb b/spec/support/helpers/metrics_dashboard_helpers.rb
index 1f36b0e217c..6de00eea474 100644
--- a/spec/support/helpers/metrics_dashboard_helpers.rb
+++ b/spec/support/helpers/metrics_dashboard_helpers.rb
@@ -28,9 +28,7 @@ module MetricsDashboardHelpers
end
end
- shared_examples_for 'valid dashboard service response' do
- let(:dashboard_schema) { JSON.parse(fixture_file('lib/gitlab/metrics/dashboard/schemas/dashboard.json')) }
-
+ shared_examples_for 'valid dashboard service response for schema' do
it 'returns a json representation of the dashboard' do
result = service_call
@@ -40,4 +38,16 @@ module MetricsDashboardHelpers
expect(JSON::Validator.fully_validate(dashboard_schema, result[:dashboard])).to be_empty
end
end
+
+ shared_examples_for 'valid dashboard service response' do
+ let(:dashboard_schema) { JSON.parse(fixture_file('lib/gitlab/metrics/dashboard/schemas/dashboard.json')) }
+
+ it_behaves_like 'valid dashboard service response for schema'
+ end
+
+ shared_examples_for 'valid embedded dashboard service response' do
+ let(:dashboard_schema) { JSON.parse(fixture_file('lib/gitlab/metrics/dashboard/schemas/embedded_dashboard.json')) }
+
+ it_behaves_like 'valid dashboard service response for schema'
+ end
end