diff options
author | Michael Kozono <mkozono@gmail.com> | 2019-04-05 23:07:05 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2019-04-05 23:07:05 +0300 |
commit | d793d4a7c30c7e16e43b8f4d393c393fe9e7ab3f (patch) | |
tree | 5b47c54e9f6e24efbe8c416a437f8adb413efa3d /spec/requests | |
parent | e3fedd68c253dace20a380bc2a4193aa5bf243ab (diff) | |
parent | c56970e3f72192bf02a0cae535b45357981a848a (diff) |
Merge branch 'duplicate-related-mrs' into 'master'
Remove duplicates from issue related merge requests
See merge request gitlab-org/gitlab-ce!27067
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index a5434d3ea80..86484ce62f8 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -2189,6 +2189,18 @@ describe API::Issues do expect_paginated_array_response(related_mr.id) end + context 'merge request closes an issue' do + let!(:closing_issue_mr_rel) do + create(:merge_requests_closing_issues, issue: issue, merge_request: related_mr) + end + + it 'returns closing MR only once' do + get_related_merge_requests(project.id, issue.iid, user) + + expect_paginated_array_response([related_mr.id]) + end + end + context 'no merge request mentioned a issue' do it 'returns empty array' do get_related_merge_requests(project.id, closed_issue.iid, user) |