diff options
Diffstat (limited to 'spec/requests/api/debian_group_packages_spec.rb')
-rw-r--r-- | spec/requests/api/debian_group_packages_spec.rb | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/spec/requests/api/debian_group_packages_spec.rb b/spec/requests/api/debian_group_packages_spec.rb index d881d4350fb..9dbb75becf8 100644 --- a/spec/requests/api/debian_group_packages_spec.rb +++ b/spec/requests/api/debian_group_packages_spec.rb @@ -36,12 +36,42 @@ RSpec.describe API::DebianGroupPackages do it_behaves_like 'Debian packages read endpoint', 'GET', :success, /Description: This is an incomplete Packages file/ end + describe 'GET groups/:id/-/packages/debian/dists/*distribution/:component/binary-:architecture/by-hash/SHA256/:file_sha256' do + let(:url) { "/groups/#{container.id}/-/packages/debian/dists/#{distribution.codename}/#{component.name}/binary-#{architecture.name}/by-hash/SHA256/#{component_file_older_sha256.file_sha256}" } + + it_behaves_like 'Debian packages read endpoint', 'GET', :success, /^Other SHA256$/ + end + + describe 'GET groups/:id/-/packages/debian/dists/*distribution/:component/source/Sources' do + let(:url) { "/groups/#{container.id}/-/packages/debian/dists/#{distribution.codename}/#{component.name}/source/Sources" } + + it_behaves_like 'Debian packages read endpoint', 'GET', :success, /Description: This is an incomplete Sources file/ + end + + describe 'GET groups/:id/-/packages/debian/dists/*distribution/:component/source/by-hash/SHA256/:file_sha256' do + let(:url) { "/groups/#{container.id}/-/packages/debian/dists/#{distribution.codename}/#{component.name}/source/by-hash/SHA256/#{component_file_sources_older_sha256.file_sha256}" } + + it_behaves_like 'Debian packages read endpoint', 'GET', :success, /^Other SHA256$/ + end + + describe 'GET groups/:id/-/packages/debian/dists/*distribution/:component/debian-installer/binary-:architecture/Packages' do + let(:url) { "/groups/#{container.id}/-/packages/debian/dists/#{distribution.codename}/#{component.name}/debian-installer/binary-#{architecture.name}/Packages" } + + it_behaves_like 'Debian packages read endpoint', 'GET', :success, /Description: This is an incomplete D-I Packages file/ + end + + describe 'GET groups/:id/-/packages/debian/dists/*distribution/:component/debian-installer/binary-:architecture/by-hash/SHA256/:file_sha256' do + let(:url) { "/groups/#{container.id}/-/packages/debian/dists/#{distribution.codename}/#{component.name}/debian-installer/binary-#{architecture.name}/by-hash/SHA256/#{component_file_di_older_sha256.file_sha256}" } + + it_behaves_like 'Debian packages read endpoint', 'GET', :success, /^Other SHA256$/ + end + describe 'GET groups/:id/-/packages/debian/pool/:codename/:project_id/:letter/:package_name/:package_version/:file_name' do + using RSpec::Parameterized::TableSyntax + let(:url) { "/groups/#{container.id}/-/packages/debian/pool/#{package.debian_distribution.codename}/#{project.id}/#{letter}/#{package.name}/#{package.version}/#{file_name}" } let(:file_name) { params[: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\)/ @@ -53,6 +83,12 @@ RSpec.describe API::DebianGroupPackages do with_them do it_behaves_like 'Debian packages read endpoint', 'GET', :success, params[:success_body] + + context 'for bumping last downloaded at' do + include_context 'Debian repository access', :public, :developer, :basic do + it_behaves_like 'bumping the package last downloaded at field' + end + end end end end |