summaryrefslogtreecommitdiff
path: root/doc/development/api_styleguide.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 15:08:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 15:08:08 +0000
commit946771d0b016ae92b15a60bc3290a33b94191ffe (patch)
tree64862c2433989483f5fce45d5539242577a362eb /doc/development/api_styleguide.md
parentf1e2fca19a90a6992c2020cf8c2159cfb0b61bca (diff)
downloadgitlab-ce-946771d0b016ae92b15a60bc3290a33b94191ffe.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/api_styleguide.md')
-rw-r--r--doc/development/api_styleguide.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/development/api_styleguide.md b/doc/development/api_styleguide.md
index 2510358b4d5..bd5ea6ac506 100644
--- a/doc/development/api_styleguide.md
+++ b/doc/development/api_styleguide.md
@@ -118,3 +118,11 @@ different components are making use of.
[Entity]: https://gitlab.com/gitlab-org/gitlab/blob/master/lib/api/entities.rb
[validation, and coercion of the parameters]: https://github.com/ruby-grape/grape#parameter-validation-and-coercion
[installing GitLab under a relative URL]: https://docs.gitlab.com/ee/install/relative_url.html
+
+## Testing
+
+When writing tests for new API endpoints, consider using a schema [fixture](./testing_guide/best_practices.md#fixtures) located in `/spec/fixtures/api/schemas`. You can `expect` a response to match a given schema:
+
+```ruby
+expect(response).to match_response_schema('merge_requests')
+```