diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /spec/controllers/concerns/metrics_dashboard_spec.rb | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'spec/controllers/concerns/metrics_dashboard_spec.rb')
-rw-r--r-- | spec/controllers/concerns/metrics_dashboard_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/controllers/concerns/metrics_dashboard_spec.rb b/spec/controllers/concerns/metrics_dashboard_spec.rb index d68a9d70ec6..4a9c7c493a7 100644 --- a/spec/controllers/concerns/metrics_dashboard_spec.rb +++ b/spec/controllers/concerns/metrics_dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe MetricsDashboard do +RSpec.describe MetricsDashboard, feature_category: :metrics do include MetricsDashboardHelpers describe 'GET #metrics_dashboard' do @@ -11,6 +11,7 @@ RSpec.describe MetricsDashboard do let_it_be(:environment) { create(:environment, project: project) } before do + stub_feature_flags(remove_monitor_metrics: false) sign_in(user) project.add_maintainer(user) end @@ -179,5 +180,16 @@ RSpec.describe MetricsDashboard do end end end + + context 'when metrics dashboard feature is unavailable' do + it 'returns 404 not found' do + stub_feature_flags(remove_monitor_metrics: true) + + routes.draw { get "metrics_dashboard" => "anonymous#metrics_dashboard" } + response = get :metrics_dashboard, format: :json + + expect(response).to have_gitlab_http_status(:not_found) + end + end end end |