diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-11-07 17:57:16 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-11-07 17:57:16 +0300 |
commit | fadaa3d181b26c420a2424d35780cddc9fc32ce0 (patch) | |
tree | 8f1d3b86319b9c6778d2b1910598763db0624f7b /spec | |
parent | ac8f157301fed1ce83969ff4bb9aa6dc99a895e6 (diff) | |
parent | 4d23090877c2af3634a7f02802fb765d969bd38e (diff) |
Merge branch 'dm-api-merge-requests-index-merged-at' into 'master'
Expose {closed,merged}_{at,by} in merge requests API index
Closes #52031
See merge request gitlab-org/gitlab-ce!22806
Diffstat (limited to 'spec')
-rw-r--r-- | spec/fixtures/api/schemas/public_api/v4/merge_requests.json | 26 | ||||
-rw-r--r-- | spec/support/shared_examples/requests/api/merge_requests_list.rb | 7 |
2 files changed, 32 insertions, 1 deletions
diff --git a/spec/fixtures/api/schemas/public_api/v4/merge_requests.json b/spec/fixtures/api/schemas/public_api/v4/merge_requests.json index f7adc4e0b91..6df27bf32b9 100644 --- a/spec/fixtures/api/schemas/public_api/v4/merge_requests.json +++ b/spec/fixtures/api/schemas/public_api/v4/merge_requests.json @@ -9,6 +9,32 @@ "title": { "type": "string" }, "description": { "type": ["string", "null"] }, "state": { "type": "string" }, + "merged_by": { + "type": ["object", "null"], + "properties": { + "name": { "type": "string" }, + "username": { "type": "string" }, + "id": { "type": "integer" }, + "state": { "type": "string" }, + "avatar_url": { "type": "uri" }, + "web_url": { "type": "uri" } + }, + "additionalProperties": false + }, + "merged_at": { "type": ["date", "null"] }, + "closed_by": { + "type": ["object", "null"], + "properties": { + "name": { "type": "string" }, + "username": { "type": "string" }, + "id": { "type": "integer" }, + "state": { "type": "string" }, + "avatar_url": { "type": "uri" }, + "web_url": { "type": "uri" } + }, + "additionalProperties": false + }, + "closed_at": { "type": ["date", "null"] }, "created_at": { "type": "date" }, "updated_at": { "type": "date" }, "target_branch": { "type": "string" }, diff --git a/spec/support/shared_examples/requests/api/merge_requests_list.rb b/spec/support/shared_examples/requests/api/merge_requests_list.rb index 1aed8ab0113..668a390b5d2 100644 --- a/spec/support/shared_examples/requests/api/merge_requests_list.rb +++ b/spec/support/shared_examples/requests/api/merge_requests_list.rb @@ -16,7 +16,12 @@ shared_examples 'merge requests list' do create(:merge_request, state: 'closed', milestone: milestone1, author: user, assignee: user, source_project: project, target_project: project, title: 'Test', created_at: base_time) - create(:merge_request, milestone: milestone1, author: user, assignee: user, source_project: project, target_project: project, title: 'Test', created_at: base_time) + merge_request = create(:merge_request, milestone: milestone1, author: user, assignee: user, source_project: project, target_project: project, title: 'Test', created_at: base_time) + + merge_request.metrics.update!(merged_by: user, + latest_closed_by: user, + latest_closed_at: 1.hour.ago, + merged_at: 2.hours.ago) expect do get api(endpoint_path, user) |