diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 21:08:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 21:08:45 +0300 |
commit | 26a50872e9da9509c52c70f74dc21698fec906db (patch) | |
tree | b1bd36bd72e701e346ef880fc7a905f6186525e7 /spec/controllers/concerns | |
parent | b3a736ed88a1db0391cd9881e70b987bab7d89d1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/concerns')
-rw-r--r-- | spec/controllers/concerns/metrics_dashboard_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/concerns/metrics_dashboard_spec.rb b/spec/controllers/concerns/metrics_dashboard_spec.rb index 466021d6ecd..4e42171e3d3 100644 --- a/spec/controllers/concerns/metrics_dashboard_spec.rb +++ b/spec/controllers/concerns/metrics_dashboard_spec.rb @@ -45,6 +45,7 @@ describe MetricsDashboard do it 'returns the specified dashboard' do expect(json_response['dashboard']['dashboard']).to eq('Environment metrics') expect(json_response).not_to have_key('all_dashboards') + expect(json_response).not_to have_key('metrics_data') end context 'when the params are in an alternate format' do @@ -53,6 +54,25 @@ describe MetricsDashboard do it 'returns the specified dashboard' do expect(json_response['dashboard']['dashboard']).to eq('Environment metrics') expect(json_response).not_to have_key('all_dashboards') + expect(json_response).not_to have_key('metrics_data') + end + end + + context 'when environment for dashboard is available' do + let(:params) { { environment: environment } } + + before do + allow(controller).to receive(:project).and_return(project) + allow(controller).to receive(:environment).and_return(environment) + allow(controller) + .to receive(:metrics_dashboard_params) + .and_return(params) + end + + it 'returns the specified dashboard' do + expect(json_response['dashboard']['dashboard']).to eq('Environment metrics') + expect(json_response).not_to have_key('all_dashboards') + expect(json_response).to have_key('metrics_data') end end |