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>2021-05-19 18:44:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /spec/services/application_settings
parente570267f2f6b326480d284e0164a6464ba4081bc (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.rb26
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
{