summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2018-08-26 19:02:09 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2019-01-31 13:49:50 +0100
commitf17d10c451138f801176e2bde3f8bc9ba31823e9 (patch)
tree68a24a2860895907c78baedba723b9463eb47fcf /spec
parentcc6d45997263fa5110924856fdf04c870a482daf (diff)
downloadgitlab-ce-f17d10c451138f801176e2bde3f8bc9ba31823e9.tar.gz
Use a schema matcher to capture all entity members
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/api/schemas/public_api/v4/group_labels.json17
-rw-r--r--spec/requests/api/group_labels_spec.rb1
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/fixtures/api/schemas/public_api/v4/group_labels.json b/spec/fixtures/api/schemas/public_api/v4/group_labels.json
new file mode 100644
index 00000000000..bcd027da5aa
--- /dev/null
+++ b/spec/fixtures/api/schemas/public_api/v4/group_labels.json
@@ -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
+ }
+}
diff --git a/spec/requests/api/group_labels_spec.rb b/spec/requests/api/group_labels_spec.rb
index 3eeeae2aaca..8e368a0ce39 100644
--- a/spec/requests/api/group_labels_spec.rb
+++ b/spec/requests/api/group_labels_spec.rb
@@ -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)