diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/requests/api/pypi_packages_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/requests/api/pypi_packages_spec.rb')
-rw-r--r-- | spec/requests/api/pypi_packages_spec.rb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/spec/requests/api/pypi_packages_spec.rb b/spec/requests/api/pypi_packages_spec.rb index e66326db2a2..8df2460a2b6 100644 --- a/spec/requests/api/pypi_packages_spec.rb +++ b/spec/requests/api/pypi_packages_spec.rb @@ -13,7 +13,7 @@ RSpec.describe API::PypiPackages do let_it_be(:personal_access_token) { create(:personal_access_token, user: user) } let_it_be(:deploy_token) { create(:deploy_token, read_package_registry: true, write_package_registry: true) } let_it_be(:project_deploy_token) { create(:project_deploy_token, deploy_token: deploy_token, project: project) } - let_it_be(:job) { create(:ci_build, :running, user: user, project: project) } + let_it_be(:job) { create(:ci_build, :running, user: user) } let(:headers) { {} } @@ -23,7 +23,8 @@ RSpec.describe API::PypiPackages do subject { get api(url), headers: headers } describe 'GET /api/v4/groups/:id/-/packages/pypi/simple/:package_name' do - let(:url) { "/groups/#{group.id}/-/packages/pypi/simple/#{package.name}" } + let(:package_name) { package.name } + let(:url) { "/groups/#{group.id}/-/packages/pypi/simple/#{package_name}" } let(:snowplow_gitlab_standard_context) { {} } it_behaves_like 'pypi simple API endpoint' @@ -38,6 +39,12 @@ RSpec.describe API::PypiPackages do end it_behaves_like 'deploy token for package GET requests' + + context 'with group path as id' do + let(:url) { "/groups/#{CGI.escape(group.full_path)}/-/packages/pypi/simple/#{package_name}"} + + it_behaves_like 'deploy token for package GET requests' + end end context 'job token' do @@ -54,13 +61,20 @@ RSpec.describe API::PypiPackages do end describe 'GET /api/v4/projects/:id/packages/pypi/simple/:package_name' do - let(:url) { "/projects/#{project.id}/packages/pypi/simple/#{package.name}" } + let(:package_name) { package.name } + let(:url) { "/projects/#{project.id}/packages/pypi/simple/#{package_name}" } let(:snowplow_gitlab_standard_context) { { project: project, namespace: project.namespace } } it_behaves_like 'pypi simple API endpoint' it_behaves_like 'rejects PyPI access with unknown project id' it_behaves_like 'deploy token for package GET requests' it_behaves_like 'job token for package GET requests' + + context 'with project path as id' do + let(:url) { "/projects/#{CGI.escape(project.full_path)}/packages/pypi/simple/#{package.name}" } + + it_behaves_like 'deploy token for package GET requests' + end end end |