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-08-27 03:08:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-27 03:08:45 +0300
commitd9c4e920ed70224d4e3a47b2a1c866a4f6f37ce4 (patch)
tree95fa3467e085c3737b29f217faaf6188c14a27f5 /spec/services
parent9f6c0ac9fd6921bc0b5190ed4d4eaf0ab1e1f2d7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-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 56c1284927d..30f606a1cd3 100644
--- a/spec/services/application_settings/update_service_spec.rb
+++ b/spec/services/application_settings/update_service_spec.rb
@@ -362,6 +362,32 @@ RSpec.describe ApplicationSettings::UpdateService do
end
end
+ context 'when files API rate limits are passed' do
+ let(:params) do
+ {
+ throttle_unauthenticated_files_api_enabled: 1,
+ throttle_unauthenticated_files_api_period_in_seconds: 500,
+ throttle_unauthenticated_files_api_requests_per_period: 20,
+ throttle_authenticated_files_api_enabled: 1,
+ throttle_authenticated_files_api_period_in_seconds: 600,
+ throttle_authenticated_files_api_requests_per_period: 10
+ }
+ end
+
+ it 'updates files API throttle settings' do
+ subject.execute
+
+ application_settings.reload
+
+ expect(application_settings.throttle_unauthenticated_files_api_enabled).to be_truthy
+ expect(application_settings.throttle_unauthenticated_files_api_period_in_seconds).to eq(500)
+ expect(application_settings.throttle_unauthenticated_files_api_requests_per_period).to eq(20)
+ expect(application_settings.throttle_authenticated_files_api_enabled).to be_truthy
+ expect(application_settings.throttle_authenticated_files_api_period_in_seconds).to eq(600)
+ expect(application_settings.throttle_authenticated_files_api_requests_per_period).to eq(10)
+ end
+ end
+
context 'when issues_create_limit is passed' do
let(:params) do
{