diff options
author | Rémy Coutable <remy@rymai.me> | 2017-12-20 16:59:39 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-12-20 16:59:39 +0300 |
commit | 7429a1f18c2148f00b4675687a0ad89b4db6eec6 (patch) | |
tree | aca5fc0e8fb4c25f75f6a02cae3cfd27467d6241 /spec | |
parent | cc8ff768d712cabf7311802cec026654f005b88b (diff) | |
parent | 055543b915c13df57e13629cd49ca9d63b6e3e76 (diff) |
Merge branch '38318-search-merge-requests-with-api' into 'master'
Resolve "Search merge-requests with API"
Closes #38318
See merge request gitlab-org/gitlab-ce!16029
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 91616da6d9a..60dbd74d59d 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -150,6 +150,26 @@ describe API::MergeRequests do expect(json_response.length).to eq(1) expect(json_response.first['id']).to eq(merge_request3.id) end + + context 'search params' do + before do + merge_request.update(title: 'Search title', description: 'Search description') + end + + it 'returns merge requests matching given search string for title' do + get api("/merge_requests", user), search: merge_request.title + + expect(json_response.length).to eq(1) + expect(json_response.first['id']).to eq(merge_request.id) + end + + it 'returns merge requests for project matching given search string for description' do + get api("/merge_requests", user), project_id: project.id, search: merge_request.description + + expect(json_response.length).to eq(1) + expect(json_response.first['id']).to eq(merge_request.id) + end + end end end |