From 3e2c9db1364f4063d7e724b2d499e76e8a04fcb5 Mon Sep 17 00:00:00 2001 From: Laila Winner Date: Fri, 30 Oct 2015 10:52:25 -0700 Subject: [PATCH] Use different integration testing strategies depending on API consumer --- best-practices/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/best-practices/README.md b/best-practices/README.md index 3e183593..785159e3 100644 --- a/best-practices/README.md +++ b/best-practices/README.md @@ -335,8 +335,11 @@ Ruby JSON APIs * Follow Heroku's [HTTP API Design Guide] * Use a fast JSON parser, e.g. [`oj`][oj] -* Write [request specs] for your API endpoints +* Write integration tests for your API endpoints. When the primary consumer of + your API is an in-app JavaScript client, write [feature specs]. Otherwise + write [request specs]. [HTTP API Design Guide]: https://github.com/interagent/http-api-design [oj]: https://github.com/ohler55/oj +[feature specs]: https://www.relishapp.com/rspec/rspec-rails/docs/feature-specs/feature-spec [request specs]: https://www.relishapp.com/rspec/rspec-rails/docs/request-specs/request-spec