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/debian_group_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/debian_group_packages_spec.rb')
-rw-r--r-- | spec/requests/api/debian_group_packages_spec.rb | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/spec/requests/api/debian_group_packages_spec.rb b/spec/requests/api/debian_group_packages_spec.rb index 931eaf41891..3e11b480860 100644 --- a/spec/requests/api/debian_group_packages_spec.rb +++ b/spec/requests/api/debian_group_packages_spec.rb @@ -6,10 +6,16 @@ RSpec.describe API::DebianGroupPackages do include WorkhorseHelpers include_context 'Debian repository shared context', :group, false do + context 'with invalid parameter' do + let(:url) { "/groups/1/-/packages/debian/dists/with+space/InRelease" } + + it_behaves_like 'Debian repository GET request', :bad_request, /^distribution is invalid$/ + end + describe 'GET groups/:id/-/packages/debian/dists/*distribution/Release.gpg' do let(:url) { "/groups/#{container.id}/-/packages/debian/dists/#{distribution.codename}/Release.gpg" } - it_behaves_like 'Debian repository read endpoint', 'GET request', :not_found + it_behaves_like 'Debian repository read endpoint', 'GET request', :success, /^-----BEGIN PGP SIGNATURE-----/ end describe 'GET groups/:id/-/packages/debian/dists/*distribution/Release' do @@ -21,7 +27,7 @@ RSpec.describe API::DebianGroupPackages do describe 'GET groups/:id/-/packages/debian/dists/*distribution/InRelease' do let(:url) { "/groups/#{container.id}/-/packages/debian/dists/#{distribution.codename}/InRelease" } - it_behaves_like 'Debian repository read endpoint', 'GET request', :success, /^Codename: fixture-distribution\n$/ + it_behaves_like 'Debian repository read endpoint', 'GET request', :success, /^-----BEGIN PGP SIGNED MESSAGE-----/ end describe 'GET groups/:id/-/packages/debian/dists/*distribution/:component/binary-:architecture/Packages' do @@ -30,10 +36,25 @@ RSpec.describe API::DebianGroupPackages do it_behaves_like 'Debian repository read endpoint', 'GET request', :success, /Description: This is an incomplete Packages file/ end - describe 'GET groups/:id/-/packages/debian/pool/:component/:letter/:source_package/:file_name' do - let(:url) { "/groups/#{container.id}/-/packages/debian/pool/#{component.name}/#{letter}/#{source_package}/#{package_name}_#{package_version}_#{architecture.name}.deb" } + describe 'GET groups/:id/-/packages/debian/pool/:codename/:project_id/:letter/:package_name/:package_version/:file_name' do + let(:url) { "/groups/#{container.id}/-/packages/debian/pool/#{package.debian_distribution.codename}/#{project.id}/#{letter}/#{package.name}/#{package.version}/#{file_name}" } + + using RSpec::Parameterized::TableSyntax + + where(:file_name, :success_body) do + 'sample_1.2.3~alpha2.tar.xz' | /^.7zXZ/ + 'sample_1.2.3~alpha2.dsc' | /^Format: 3.0 \(native\)/ + 'libsample0_1.2.3~alpha2_amd64.deb' | /^!<arch>/ + 'sample-udeb_1.2.3~alpha2_amd64.udeb' | /^!<arch>/ + 'sample_1.2.3~alpha2_amd64.buildinfo' | /Build-Tainted-By/ + 'sample_1.2.3~alpha2_amd64.changes' | /urgency=medium/ + end + + with_them do + include_context 'with file_name', params[:file_name] - it_behaves_like 'Debian repository read endpoint', 'GET request', :success, /^TODO File$/ + it_behaves_like 'Debian repository read endpoint', 'GET request', :success, params[:success_body] + end end end end |