diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/services/application_settings | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/services/application_settings')
-rw-r--r-- | spec/services/application_settings/update_service_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/services/application_settings/update_service_spec.rb b/spec/services/application_settings/update_service_spec.rb index 258b3d25aee..56c1284927d 100644 --- a/spec/services/application_settings/update_service_spec.rb +++ b/spec/services/application_settings/update_service_spec.rb @@ -336,6 +336,32 @@ RSpec.describe ApplicationSettings::UpdateService do end end + context 'when package registry rate limits are passed' do + let(:params) do + { + throttle_unauthenticated_packages_api_enabled: 1, + throttle_unauthenticated_packages_api_period_in_seconds: 500, + throttle_unauthenticated_packages_api_requests_per_period: 20, + throttle_authenticated_packages_api_enabled: 1, + throttle_authenticated_packages_api_period_in_seconds: 600, + throttle_authenticated_packages_api_requests_per_period: 10 + } + end + + it 'updates package registry throttle settings' do + subject.execute + + application_settings.reload + + expect(application_settings.throttle_unauthenticated_packages_api_enabled).to be_truthy + expect(application_settings.throttle_unauthenticated_packages_api_period_in_seconds).to eq(500) + expect(application_settings.throttle_unauthenticated_packages_api_requests_per_period).to eq(20) + expect(application_settings.throttle_authenticated_packages_api_enabled).to be_truthy + expect(application_settings.throttle_authenticated_packages_api_period_in_seconds).to eq(600) + expect(application_settings.throttle_authenticated_packages_api_requests_per_period).to eq(10) + end + end + context 'when issues_create_limit is passed' do let(:params) do { |