Commit 705af7d5 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'add-destroy-url-to-packages-list-apio' into 'master'

Updates package list api with destroy url

See merge request gitlab-org/gitlab!22503
parents 16363f28 72bc61b6
---
title: Includes _link object in packages list api
merge_request: 22503
author:
type: added
...@@ -24,7 +24,7 @@ module API ...@@ -24,7 +24,7 @@ module API
get ':id/packages' do get ':id/packages' do
packages = user_project.packages packages = user_project.packages
present paginate(packages), with: EE::API::Entities::Package present paginate(packages), with: EE::API::Entities::Package, user: current_user
end end
desc 'Get a single project package' do desc 'Get a single project package' do
......
...@@ -41,6 +41,18 @@ describe API::ProjectPackages do ...@@ -41,6 +41,18 @@ describe API::ProjectPackages do
it_behaves_like 'returns packages', :project, :reporter 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, :no_type, :not_found
it_behaves_like 'rejects packages access', :project, :guest, :forbidden 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
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