diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-04 01:44:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-04 01:44:35 +0300 |
commit | 96722e6de1c1f91f62f9ee645c5ad3ec7b05282c (patch) | |
tree | d80ec8b3505fc3055cc8d7ed7f864edc831b7119 /spec/requests/api | |
parent | b2a2fb69e663aabd66fe2fe8696c49e68c2fbe02 (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-ee
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/pypi_packages_spec.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/requests/api/pypi_packages_spec.rb b/spec/requests/api/pypi_packages_spec.rb index 59d93cd48e3..978d4f72a4a 100644 --- a/spec/requests/api/pypi_packages_spec.rb +++ b/spec/requests/api/pypi_packages_spec.rb @@ -256,19 +256,35 @@ RSpec.describe API::PypiPackages, feature_category: :package_registry do let(:headers) { user_headers.merge(workhorse_headers) } it_behaves_like 'PyPI package creation', :developer, :created, true + + context 'with FIPS mode', :fips_mode do + it_behaves_like 'PyPI package creation', :developer, :created, true, false + end end - context 'without md5_digest' do + context 'without sha256_digest' do let(:token) { personal_access_token.token } let(:user_headers) { basic_auth_header(user.username, token) } let(:headers) { user_headers.merge(workhorse_headers) } let(:params) { base_params.merge(content: temp_file(file_name)) } before do - params.delete(:md5_digest) + params.delete(:sha256_digest) end - it_behaves_like 'PyPI package creation', :developer, :created, true, false + it_behaves_like 'PyPI package creation', :developer, :created, true, true + + context 'with FIPS mode', :fips_mode do + before do + project.add_developer(user) + end + + it 'returns 422 and does not create a package' do + expect { subject }.not_to change { project.packages.pypi.count } + + expect(response).to have_gitlab_http_status(:unprocessable_entity) + end + end end end |