diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
commit | 43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch) | |
tree | dceebdc68925362117480a5d672bcff122fb625b /spec/requests/api/usage_data_non_sql_metrics_spec.rb | |
parent | 20c84b99005abd1c82101dfeff264ac50d2df211 (diff) |
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'spec/requests/api/usage_data_non_sql_metrics_spec.rb')
-rw-r--r-- | spec/requests/api/usage_data_non_sql_metrics_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/requests/api/usage_data_non_sql_metrics_spec.rb b/spec/requests/api/usage_data_non_sql_metrics_spec.rb index 0a6f248af2c..b2929caf676 100644 --- a/spec/requests/api/usage_data_non_sql_metrics_spec.rb +++ b/spec/requests/api/usage_data_non_sql_metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe API::UsageDataNonSqlMetrics, feature_category: :service_ping do +RSpec.describe API::UsageDataNonSqlMetrics, :aggregate_failures, feature_category: :service_ping do include UsageDataHelpers let_it_be(:admin) { create(:user, admin: true) } @@ -21,8 +21,12 @@ RSpec.describe API::UsageDataNonSqlMetrics, feature_category: :service_ping do stub_database_flavor_check end + it_behaves_like 'GET request permissions for admin mode' do + let(:path) { endpoint } + end + it 'returns non sql metrics if user is admin' do - get api(endpoint, admin) + get api(endpoint, admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response['counts']).to be_a(Hash) @@ -53,7 +57,7 @@ RSpec.describe API::UsageDataNonSqlMetrics, feature_category: :service_ping do end it 'returns not_found for admin' do - get api(endpoint, admin) + get api(endpoint, admin, admin_mode: true) expect(response).to have_gitlab_http_status(:not_found) end |