Skip to content

Commit 7ed08fc

Browse files
committed
Fix style
1 parent fd88b0c commit 7ed08fc

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

doc/api/merge_requests.md

-2
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ Parameters:
444444
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
445445
- `merge_request_iid` (required) - The internal ID of the merge request
446446

447-
Example of response
448-
449447
```json
450448
[
451449
{

lib/api/merge_requests.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ def find_merge_requests(args = {})
2424
.preload(:notes, :author, :assignee, :milestone, :latest_merge_request_diff, :labels, :timelogs)
2525
end
2626

27-
def merge_request_pipelines_with_access(access_level = :read_pipeline)
28-
authorize! access_level, user_project
27+
def merge_request_pipelines_with_access
28+
authorize! :read_pipeline, user_project
29+
2930
mr = find_merge_request_with_access(params[:merge_request_iid])
3031
mr.all_pipelines
3132
end

spec/requests/api/merge_requests_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,12 @@
546546
expect(response).to have_gitlab_http_status(200)
547547
expect(response).to match_response_schema('public_api/v4/pipelines')
548548
end
549+
550+
it 'returns 404 if MR does not exist' do
551+
get api("/projects/#{project.id}/merge_requests/777/pipelines")
552+
553+
expect(response).to have_gitlab_http_status(404)
554+
end
549555
end
550556

551557
context 'when unauthorized' do

0 commit comments

Comments
 (0)