2021-01-03 14:25:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe API::DebianProjectPackages do
|
|
|
|
include HttpBasicAuthHelpers
|
|
|
|
include WorkhorseHelpers
|
|
|
|
|
|
|
|
include_context 'Debian repository shared context', :project do
|
2021-03-11 19:13:27 +05:30
|
|
|
describe 'GET projects/:id/packages/debian/dists/*distribution/Release.gpg' do
|
|
|
|
let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/Release.gpg" }
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
it_behaves_like 'Debian project repository GET endpoint', :not_found, nil
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
describe 'GET projects/:id/packages/debian/dists/*distribution/Release' do
|
|
|
|
let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/Release" }
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Release'
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
describe 'GET projects/:id/packages/debian/dists/*distribution/InRelease' do
|
|
|
|
let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/InRelease" }
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
it_behaves_like 'Debian project repository GET endpoint', :not_found, nil
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
describe 'GET projects/:id/packages/debian/dists/*distribution/:component/binary-:architecture/Packages' do
|
|
|
|
let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/#{component}/binary-#{architecture}/Packages" }
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Packages'
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
describe 'GET projects/:id/packages/debian/pool/:component/:letter/:source_package/:file_name' do
|
|
|
|
let(:url) { "/projects/#{project.id}/packages/debian/pool/#{component}/#{letter}/#{source_package}/#{package_name}_#{package_version}_#{architecture}.deb" }
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO File'
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
describe 'PUT projects/:id/packages/debian/:file_name' do
|
2021-01-03 14:25:43 +05:30
|
|
|
let(:method) { :put }
|
2021-03-11 19:13:27 +05:30
|
|
|
let(:url) { "/projects/#{project.id}/packages/debian/#{file_name}" }
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
it_behaves_like 'Debian project repository PUT endpoint', :created, nil
|
|
|
|
end
|
2021-03-08 18:12:59 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
describe 'PUT projects/:id/packages/debian/:file_name/authorize' do
|
2021-03-08 18:12:59 +05:30
|
|
|
let(:method) { :put }
|
2021-03-11 19:13:27 +05:30
|
|
|
let(:url) { "/projects/#{project.id}/packages/debian/#{file_name}/authorize" }
|
2021-03-08 18:12:59 +05:30
|
|
|
|
|
|
|
it_behaves_like 'Debian project repository PUT endpoint', :created, nil, is_authorize: true
|
|
|
|
end
|
2021-01-03 14:25:43 +05:30
|
|
|
end
|
|
|
|
end
|