diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-07 21:08:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-07 21:08:32 +0300 |
commit | dff0f3475c8dc49daccb1f9fd2399b881e6cc1f0 (patch) | |
tree | f61feff669dfa72bb8f03e8c3d0d38df45be5263 /spec/requests/projects | |
parent | cf24d183b3f71f091a02f12b211f3001be5b5085 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/projects')
-rw-r--r-- | spec/requests/projects/metrics_dashboard_spec.rb | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/spec/requests/projects/metrics_dashboard_spec.rb b/spec/requests/projects/metrics_dashboard_spec.rb index 2f78d104529..f0e0e6a02ee 100644 --- a/spec/requests/projects/metrics_dashboard_spec.rb +++ b/spec/requests/projects/metrics_dashboard_spec.rb @@ -25,15 +25,16 @@ RSpec.describe 'Projects::MetricsDashboardController' do end it 'retains existing parameters when redirecting' do - get "#{dashboard_route(dashboard_path: '.gitlab/dashboards/dashboard_path.yml')}/panel/new" - - expect(response).to redirect_to( - dashboard_route( - dashboard_path: '.gitlab/dashboards/dashboard_path.yml', - page: 'panel/new', - environment: environment - ) - ) + params = { + dashboard_path: '.gitlab/dashboards/dashboard_path.yml', + page: 'panel/new', + group: 'System metrics (Kubernetes)', + title: 'Memory Usage (Pod average)', + y_label: 'Memory Used per Pod (MB)' + } + send_request(params) + + expect(response).to redirect_to(dashboard_route(params.merge(environment: environment.id))) end context 'with anonymous user and public dashboard visibility' do @@ -110,15 +111,13 @@ RSpec.describe 'Projects::MetricsDashboardController' do describe 'GET :/namespace/:project/-/metrics/:page' do it 'returns 200 with path param page' do - # send_request(page: 'panel/new') cannot be used because it encodes '/' - get "#{dashboard_route}/panel/new?environment=#{environment.id}" + send_request(page: 'panel/new', environment: environment.id) expect(response).to have_gitlab_http_status(:ok) end it 'returns 200 with dashboard and path param page' do - # send_request(page: 'panel/new') cannot be used because it encodes '/' - get "#{dashboard_route(dashboard_path: 'dashboard.yml')}/panel/new?environment=#{environment.id}" + send_request(dashboard_path: 'dashboard.yml', page: 'panel/new', environment: environment.id) expect(response).to have_gitlab_http_status(:ok) end |