Use a schema matcher to capture all entity members
This commit is contained in:
parent
cc6d459972
commit
f17d10c451
2 changed files with 18 additions and 0 deletions
17
spec/fixtures/api/schemas/public_api/v4/group_labels.json
vendored
Normal file
17
spec/fixtures/api/schemas/public_api/v4/group_labels.json
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties" : {
|
||||||
|
"id" : { "type": "integer" },
|
||||||
|
"name" : { "type": "string "},
|
||||||
|
"color" : { "type": "string "},
|
||||||
|
"description" : { "type": "string "},
|
||||||
|
"open_issues_count" : { "type": "integer "},
|
||||||
|
"closed_issues_count" : { "type": "integer "},
|
||||||
|
"open_merge_requests_count" : { "type": "integer "},
|
||||||
|
"subscribed" : { "type": "boolean" }
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,6 +14,7 @@ describe API::GroupLabels do
|
||||||
get api("/groups/#{group.id}/labels", user)
|
get api("/groups/#{group.id}/labels", user)
|
||||||
|
|
||||||
expect(response).to have_gitlab_http_status(200)
|
expect(response).to have_gitlab_http_status(200)
|
||||||
|
expect(response).to match_response_schema('public_api/v4/group_labels')
|
||||||
expect(response).to include_pagination_headers
|
expect(response).to include_pagination_headers
|
||||||
expect(json_response).to be_an Array
|
expect(json_response).to be_an Array
|
||||||
expect(json_response.size).to eq(2)
|
expect(json_response.size).to eq(2)
|
||||||
|
|
Loading…
Reference in a new issue