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-10-20 11:43:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-20 11:43:02 +0300
commitd9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch)
tree2341ef426af70ad1e289c38036737e04b0aa5007 /spec/services/application_settings
parentd6e514dd13db8947884cd58fe2a9c2a063400a9b (diff)
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.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 a1fd89bcad7..5c9d2c5e680 100644
--- a/spec/services/application_settings/update_service_spec.rb
+++ b/spec/services/application_settings/update_service_spec.rb
@@ -413,6 +413,32 @@ RSpec.describe ApplicationSettings::UpdateService do
end
end
+ context 'when deprecated API rate limits are passed' do
+ let(:params) do
+ {
+ throttle_unauthenticated_deprecated_api_enabled: 1,
+ throttle_unauthenticated_deprecated_api_period_in_seconds: 500,
+ throttle_unauthenticated_deprecated_api_requests_per_period: 20,
+ throttle_authenticated_deprecated_api_enabled: 1,
+ throttle_authenticated_deprecated_api_period_in_seconds: 600,
+ throttle_authenticated_deprecated_api_requests_per_period: 10
+ }
+ end
+
+ it 'updates deprecated API throttle settings' do
+ subject.execute
+
+ application_settings.reload
+
+ expect(application_settings.throttle_unauthenticated_deprecated_api_enabled).to be_truthy
+ expect(application_settings.throttle_unauthenticated_deprecated_api_period_in_seconds).to eq(500)
+ expect(application_settings.throttle_unauthenticated_deprecated_api_requests_per_period).to eq(20)
+ expect(application_settings.throttle_authenticated_deprecated_api_enabled).to be_truthy
+ expect(application_settings.throttle_authenticated_deprecated_api_period_in_seconds).to eq(600)
+ expect(application_settings.throttle_authenticated_deprecated_api_requests_per_period).to eq(10)
+ end
+ end
+
context 'when git lfs rate limits are passed' do
let(:params) do
{