Commit a4a81455 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'cleanup_get_api_services' into 'master'

Cleanup API GET service endpoint

See merge request gitlab-org/gitlab!21310
parents 0a6ec1d2 bbfc570a
......@@ -115,7 +115,7 @@ module API
end
get ":id/services/:service_slug" do
service = user_project.find_or_initialize_service(params[:service_slug].underscore)
present service, with: Entities::ProjectService, include_passwords: current_user.admin?
present service, with: Entities::ProjectService
end
end
......
......@@ -4,7 +4,6 @@ require "spec_helper"
describe API::Services do
set(:user) { create(:user) }
set(:admin) { create(:admin) }
set(:user2) { create(:user) }
set(:project) do
......@@ -88,14 +87,7 @@ describe API::Services do
expect(response).to have_gitlab_http_status(401)
end
it "returns all properties of service #{service} when authenticated as admin" do
get api("/projects/#{project.id}/services/#{dashed_service}", admin)
expect(response).to have_gitlab_http_status(200)
expect(json_response['properties'].keys).to match_array(service_instance.api_field_names)
end
it "returns properties of service #{service} other than passwords when authenticated as project owner" do
it "returns all properties of service #{service}" do
get api("/projects/#{project.id}/services/#{dashed_service}", user)
expect(response).to have_gitlab_http_status(200)
......
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