diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/requests/api/settings_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/requests/api/settings_spec.rb')
-rw-r--r-- | spec/requests/api/settings_spec.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/requests/api/settings_spec.rb b/spec/requests/api/settings_spec.rb index c724c69045e..cfda06da8f3 100644 --- a/spec/requests/api/settings_spec.rb +++ b/spec/requests/api/settings_spec.rb @@ -54,6 +54,8 @@ RSpec.describe API::Settings, 'Settings', :do_not_mock_admin_mode_setting do expect(json_response['runner_token_expiration_interval']).to be_nil expect(json_response['group_runner_token_expiration_interval']).to be_nil expect(json_response['project_runner_token_expiration_interval']).to be_nil + expect(json_response['max_export_size']).to eq(0) + expect(json_response['pipeline_limit_per_project_user_sha']).to eq(0) end end @@ -138,6 +140,7 @@ RSpec.describe API::Settings, 'Settings', :do_not_mock_admin_mode_setting do spam_check_api_key: 'SPAM_CHECK_API_KEY', mailgun_events_enabled: true, mailgun_signing_key: 'MAILGUN_SIGNING_KEY', + max_export_size: 6, disabled_oauth_sign_in_sources: 'unknown', import_sources: 'github,bitbucket', wiki_page_max_content_bytes: 12345, @@ -193,6 +196,7 @@ RSpec.describe API::Settings, 'Settings', :do_not_mock_admin_mode_setting do expect(json_response['spam_check_api_key']).to eq('SPAM_CHECK_API_KEY') expect(json_response['mailgun_events_enabled']).to be(true) expect(json_response['mailgun_signing_key']).to eq('MAILGUN_SIGNING_KEY') + expect(json_response['max_export_size']).to eq(6) expect(json_response['disabled_oauth_sign_in_sources']).to eq([]) expect(json_response['import_sources']).to match_array(%w(github bitbucket)) expect(json_response['wiki_page_max_content_bytes']).to eq(12345) @@ -736,5 +740,39 @@ RSpec.describe API::Settings, 'Settings', :do_not_mock_admin_mode_setting do ) end end + + context 'with pipeline_limit_per_project_user_sha' do + it 'updates the settings' do + put api("/application/settings", admin), params: { + pipeline_limit_per_project_user_sha: 25 + } + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response).to include( + 'pipeline_limit_per_project_user_sha' => 25 + ) + end + + it 'updates the settings with zero value' do + put api("/application/settings", admin), params: { + pipeline_limit_per_project_user_sha: 0 + } + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response).to include( + 'pipeline_limit_per_project_user_sha' => 0 + ) + end + + it 'does not allow null values' do + put api("/application/settings", admin), params: { + pipeline_limit_per_project_user_sha: nil + } + + expect(response).to have_gitlab_http_status(:bad_request) + expect(json_response['message']['pipeline_limit_per_project_user_sha']) + .to include(a_string_matching('is not a number')) + end + end end end |