diff options
author | Patrick Derichs <pderichs@gitlab.com> | 2019-02-19 14:30:07 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-02-19 14:30:07 +0300 |
commit | 42356201703b806219c86c04c2711ad9f52ce052 (patch) | |
tree | 3d6abe94e6adc52843d9584142adab87af12a9a0 /spec | |
parent | 197641c7d7278a7a8c17e318b08dec876636110a (diff) |
Add related merge request count to api response
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 033cd1b2b38..b5cc13eff29 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -421,6 +421,24 @@ describe API::Issues do expect(response).to have_gitlab_http_status(200) expect(response).to match_response_schema('public_api/v4/issues') end + + it 'returns a related merge request count of 0 if there are no related merge requests' do + get api('/issues', user) + + expect(response).to have_gitlab_http_status(200) + expect(response).to match_response_schema('public_api/v4/issues') + expect(json_response.first).to include('merge_requests_count' => 0) + end + + it 'returns a related merge request count > 0 if there are related merge requests' do + create(:merge_requests_closing_issues, issue: issue) + + get api('/issues', user) + + expect(response).to have_gitlab_http_status(200) + expect(response).to match_response_schema('public_api/v4/issues') + expect(json_response.first).to include('merge_requests_count' => 1) + end end end |