diff options
author | Sarah Yasonik <syasonik@gitlab.com> | 2019-06-20 14:06:18 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-06-20 14:06:18 +0000 |
commit | f49dd76a44ec04d35fbf3f08bd3c950d2df4de5b (patch) | |
tree | 43c53421eeb64cac700969cc0ec3a3871e5a03ee /spec/controllers | |
parent | 429f6b629b691945d8cd187b79e00cfa7eed6fa2 (diff) | |
download | gitlab-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/controllers')
-rw-r--r-- | spec/controllers/projects/environments_controller_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/controllers/projects/environments_controller_spec.rb b/spec/controllers/projects/environments_controller_spec.rb index 9699f2952f2..4c2c6160c62 100644 --- a/spec/controllers/projects/environments_controller_spec.rb +++ b/spec/controllers/projects/environments_controller_spec.rb @@ -556,6 +556,19 @@ describe Projects::EnvironmentsController do it_behaves_like 'has all dashboards' end end + + context 'when the dashboard is intended for embedding' do + let(:dashboard_params) { { format: :json, embedded: true } } + + it_behaves_like '200 response' + + context 'when a dashboard path is provided' do + let(:dashboard_params) { { format: :json, dashboard: '.gitlab/dashboards/test.yml', embedded: true } } + + # The dashboard path should simple be ignored. + it_behaves_like '200 response' + end + end end end |