Commit 6feda454 authored by Giorgenes Gelatti's avatar Giorgenes Gelatti

Updates package list api with destroy url

Adds `delete_api_path` to the packages list api
parent 3e2feecf
......@@ -24,7 +24,7 @@ module API
get ':id/packages' do
packages = user_project.packages
present paginate(packages), with: EE::API::Entities::Package
present paginate(packages), with: EE::API::Entities::Package, user: current_user
end
desc 'Get a single project package' do
......
......@@ -41,6 +41,18 @@ describe API::ProjectPackages do
it_behaves_like 'returns packages', :project, :reporter
it_behaves_like 'rejects packages access', :project, :no_type, :not_found
it_behaves_like 'rejects packages access', :project, :guest, :forbidden
context 'user is a maintainer' do
before do
project.add_maintainer(user)
end
it 'returns the destroy url' do
subject
expect(json_response.first['_links']).to include('delete_api_path')
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment