From 13876d39226b7c1b9d40a165ce9393d2a018e7f6 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 30 Dec 2018 19:43:12 +0200 Subject: Change: drop docs, keep yarns --- yarns/000.yarn | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 yarns/000.yarn (limited to 'yarns') diff --git a/yarns/000.yarn b/yarns/000.yarn new file mode 100644 index 0000000..9bd0432 --- /dev/null +++ b/yarns/000.yarn @@ -0,0 +1,52 @@ +--- +title: Effiapi test suite +author: Lars Wirzenius +... + +# Test scenarios + +This chapter descibes the effiapi API, as a [yarn][] automated +scenario test. It is meant to be understandable to Effi sysadmins, as +well as be an executable test suite for the API. + +The API is a simple RESTful HTTP API using JSON. This means that: + +* each API call is an HTTP request, with a response + +* all data is represented as JSON in the body of the request of + response + +* metadata about the data is represeneted as HTTP headers + +* standard HTTP verbs (POST, PUT, GET, DELETE) are used to indicate + the action + +* standard HTTP status codes are used to indicate result of the + request (200 = OK, 404 = not found, etc) + +## Manage memberships + +This section shows the API calls to manage a memberhip: to create the +member, to update and retrieve it, and to search memberships. + +~~~ +SCENARIO Manage memberships + +GIVEN An effiapi instance +WHEN admin requests POST /memb with body { "fullname": "James Bond" } +THEN the member id is ID + +WHEN admin requests GET /memb with header Muck-Id: ${ID} +THEN HTTP status 200 +AND HTTP body matches { "fullname": "James Bond" } +~~~ + +TODO: + +* update +* delete +* search +* members can see their own data, and can't see each others' +* member follows authn link emailed to them + +# Appendix: Yarn scenario step implementations -- cgit v1.2.1