Commit 7ed08fcd authored by Tony Rom's avatar Tony Rom

Fix style

parent fd88b0ca
...@@ -444,8 +444,6 @@ Parameters: ...@@ -444,8 +444,6 @@ Parameters:
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
- `merge_request_iid` (required) - The internal ID of the merge request - `merge_request_iid` (required) - The internal ID of the merge request
Example of response
```json ```json
[ [
{ {
......
...@@ -24,8 +24,9 @@ module API ...@@ -24,8 +24,9 @@ module API
.preload(:notes, :author, :assignee, :milestone, :latest_merge_request_diff, :labels, :timelogs) .preload(:notes, :author, :assignee, :milestone, :latest_merge_request_diff, :labels, :timelogs)
end end
def merge_request_pipelines_with_access(access_level = :read_pipeline) def merge_request_pipelines_with_access
authorize! access_level, user_project authorize! :read_pipeline, user_project
mr = find_merge_request_with_access(params[:merge_request_iid]) mr = find_merge_request_with_access(params[:merge_request_iid])
mr.all_pipelines mr.all_pipelines
end end
......
...@@ -546,6 +546,12 @@ describe API::MergeRequests do ...@@ -546,6 +546,12 @@ describe API::MergeRequests do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/pipelines') expect(response).to match_response_schema('public_api/v4/pipelines')
end end
it 'returns 404 if MR does not exist' do
get api("/projects/#{project.id}/merge_requests/777/pipelines")
expect(response).to have_gitlab_http_status(404)
end
end end
context 'when unauthorized' do context 'when unauthorized' do
......
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