diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-02-14 13:15:49 +0300 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2018-02-14 14:50:47 +0300 |
commit | f3af06526ad64e653183e4ffd0ea3bbdef5b1bda (patch) | |
tree | 20150d7ccea6d7fc61fed983e478e965bf0da332 /spec | |
parent | ed6fd101ffe1230c9f4110950e5de2b8800ce9ba (diff) |
Merge branch '42934-search-api-fix' into 'master'
Add information about projects when searching in wiki_blobs, blobs, commits scopes
Closes #42934
See merge request gitlab-org/gitlab-ce!17095
Diffstat (limited to 'spec')
4 files changed, 12 insertions, 6 deletions
diff --git a/spec/fixtures/api/schemas/public_api/v4/blobs.json b/spec/fixtures/api/schemas/public_api/v4/blobs.json index 9cb1eae3762..a812815838f 100644 --- a/spec/fixtures/api/schemas/public_api/v4/blobs.json +++ b/spec/fixtures/api/schemas/public_api/v4/blobs.json @@ -7,11 +7,12 @@ "data": { "type": "string" }, "filename": { "type": ["string"] }, "id": { "type": ["string", "null"] }, + "project_id": { "type": "integer" }, "ref": { "type": "string" }, "startline": { "type": "integer" } }, "required": [ - "basename", "data", "filename", "id", "ref", "startline" + "basename", "data", "filename", "id", "ref", "startline", "project_id" ], "additionalProperties": false } diff --git a/spec/fixtures/api/schemas/public_api/v4/commit/detail.json b/spec/fixtures/api/schemas/public_api/v4/commit/detail.json index 88a3cad62f6..477e776a804 100644 --- a/spec/fixtures/api/schemas/public_api/v4/commit/detail.json +++ b/spec/fixtures/api/schemas/public_api/v4/commit/detail.json @@ -4,9 +4,9 @@ { "$ref": "basic.json" }, { "required" : [ - "stats", "status", - "last_pipeline" + "last_pipeline", + "project_id" ], "properties": { "stats": { "$ref": "../commit_stats.json" }, @@ -16,7 +16,8 @@ { "type": "null" }, { "$ref": "../pipeline/basic.json" } ] - } + }, + "project_id": { "type": "integer" } } } ] diff --git a/spec/fixtures/api/schemas/public_api/v4/commits_details.json b/spec/fixtures/api/schemas/public_api/v4/commits_details.json new file mode 100644 index 00000000000..1f5b1ad86ef --- /dev/null +++ b/spec/fixtures/api/schemas/public_api/v4/commits_details.json @@ -0,0 +1,4 @@ +{ + "type": "array", + "items": { "$ref": "commit/detail.json" } +} diff --git a/spec/requests/api/search_spec.rb b/spec/requests/api/search_spec.rb index ddda5752f0c..9052a18c60b 100644 --- a/spec/requests/api/search_spec.rb +++ b/spec/requests/api/search_spec.rb @@ -295,7 +295,7 @@ describe API::Search do get api("/projects/#{repo_project.id}/-/search", user), scope: 'commits', search: '498214de67004b1da3d820901307bed2a68a8ef6' end - it_behaves_like 'response is correct', schema: 'public_api/v4/commits' + it_behaves_like 'response is correct', schema: 'public_api/v4/commits_details' end context 'for commits scope with project path as id' do @@ -303,7 +303,7 @@ describe API::Search 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' + it_behaves_like 'response is correct', schema: 'public_api/v4/commits_details' end context 'for blobs scope' do |