Commit ae7f16d8 authored by Patrick Bajao's avatar Patrick Bajao

Add pagination for GET /project_aliases

Includes changes to use stub_licensed_features
parent 99fba09e
......@@ -2,6 +2,8 @@
module API
class ProjectAliases < Grape::API
include PaginationParams
before { check_feature_availability }
before { authenticated_as_admin! }
......@@ -23,8 +25,11 @@ module API
desc 'Get a list of all project aliases' do
success EE::API::Entities::ProjectAlias
end
params do
use :pagination
end
get do
present ProjectAlias.all, with: EE::API::Entities::ProjectAlias
present paginate(ProjectAlias.all), with: EE::API::Entities::ProjectAlias
end
desc 'Get info of specific project alias by name' do
......
......@@ -18,7 +18,7 @@ describe Gitlab::RepoPath do
context 'with premium license' do
before do
create(:license, plan: License::PREMIUM_PLAN)
stub_licensed_features(project_aliases: true)
end
context 'project_path matches a project alias' do
......
......@@ -56,7 +56,7 @@ describe API::Internal do
context "with premium license" do
before do
create(:license, plan: License::PREMIUM_PLAN)
stub_licensed_features(project_aliases: true)
end
context "project matches a project alias" do
......
......@@ -72,7 +72,7 @@ describe API::ProjectAliases, api: true do
end
before do
create(:license, plan: License::PREMIUM_PLAN)
stub_licensed_features(project_aliases: true)
end
describe 'GET /project_aliases' do
......@@ -90,6 +90,7 @@ describe API::ProjectAliases, api: true do
it 'returns the project aliases list' do
expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/project_aliases', dir: 'ee')
expect(response).to include_pagination_headers
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