diff options
| author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-02-12 08:45:54 +0000 |
|---|---|---|
| committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-02-12 08:45:54 +0000 |
| commit | a1503cae82907f38a63b39731c60915e9c990bf5 (patch) | |
| tree | 91e6686c687c5912d605eb09e9a08f50dc144e3d /spec/requests | |
| parent | 498ade4801a822f8704390b10d178af9fe7987cb (diff) | |
| parent | 68ff219c4ec9088005ab872e141912f35ecc59f3 (diff) | |
| download | gitlab-ce-a1503cae82907f38a63b39731c60915e9c990bf5.tar.gz | |
Merge branch '42937-search-api-fix' into 'master'
API - fix searching in group/project specified by path
Closes #42937
See merge request gitlab-org/gitlab-ce!17033
Diffstat (limited to 'spec/requests')
| -rw-r--r-- | spec/requests/api/search_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/search_spec.rb b/spec/requests/api/search_spec.rb index a0026c6e11c..ddda5752f0c 100644 --- a/spec/requests/api/search_spec.rb +++ b/spec/requests/api/search_spec.rb @@ -180,6 +180,18 @@ describe API::Search do it_behaves_like 'response is correct', schema: 'public_api/v4/milestones' end + + context 'for milestones scope with group path as id' do + before do + another_project = create(:project, :public) + create(:milestone, project: project, title: 'awesome milestone') + create(:milestone, project: another_project, title: 'awesome milestone other project') + + get api("/groups/#{CGI.escape(group.full_path)}/-/search", user), scope: 'milestones', search: 'awesome' + end + + it_behaves_like 'response is correct', schema: 'public_api/v4/milestones' + end end end @@ -286,6 +298,14 @@ describe API::Search do it_behaves_like 'response is correct', schema: 'public_api/v4/commits' end + context 'for commits scope with project path as id' do + before do + get api("/projects/#{CGI.escape(repo_project.full_path)}/-/search", user), scope: 'commits', search: '498214de67004b1da3d820901307bed2a68a8ef6' + end + + it_behaves_like 'response is correct', schema: 'public_api/v4/commits' + end + context 'for blobs scope' do before do get api("/projects/#{repo_project.id}/-/search", user), scope: 'blobs', search: 'monitors' |
