Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-30 09:09:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-30 09:09:55 +0300
commit0629b103246d6c8b24e753f62ccfc8649df2c315 (patch)
tree7a68ccda8a1fbd1728bdbf97f636801843a7bdf1 /spec/requests/projects
parent2dfc1088178535959894aff4e80edb8936b9dedf (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/projects')
-rw-r--r--spec/requests/projects/metrics_dashboard_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/projects/metrics_dashboard_spec.rb b/spec/requests/projects/metrics_dashboard_spec.rb
index ab35788387c..a5a37a8be92 100644
--- a/spec/requests/projects/metrics_dashboard_spec.rb
+++ b/spec/requests/projects/metrics_dashboard_spec.rb
@@ -79,6 +79,26 @@ RSpec.describe 'metrics dashboard page' do
end
end
+ describe 'GET :/namespace/:project/-/metrics/:page' do
+ it 'returns 200 with path param page and feature flag enabled' do
+ stub_feature_flags(metrics_dashboard_new_panel_page: true)
+
+ # send_request(page: 'panel/new') cannot be used because it encodes '/'
+ get "/#{project.namespace.to_param}/#{project.to_param}/-/metrics/panel/new"
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+
+ it 'returns 404 with path param page and feature flag disabled' do
+ stub_feature_flags(metrics_dashboard_new_panel_page: false)
+
+ # send_request(page: 'panel/new') cannot be used because it encodes '/'
+ get "/#{project.namespace.to_param}/#{project.to_param}/-/metrics/panel/new"
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
+
def send_request(params = {})
get namespace_project_metrics_dashboard_path(namespace_id: project.namespace, project_id: project, **params)
end