Use a schema matcher to capture all entity members

This commit is contained in:
Robert Schilling 2018-08-26 19:02:09 +02:00
parent cc6d459972
commit f17d10c451
2 changed files with 18 additions and 0 deletions

View 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
}
}

View file

@ -14,6 +14,7 @@ describe API::GroupLabels do
get api("/groups/#{group.id}/labels", user)
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(json_response).to be_an Array
expect(json_response.size).to eq(2)