diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-12-30 19:43:12 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-12-30 19:43:12 +0200 |
commit | 13876d39226b7c1b9d40a165ce9393d2a018e7f6 (patch) | |
tree | 7e340604dc858ff0077c4ef1af249af79a4650e1 /yarns | |
parent | 58c8454cd01fc8ec5c88b51945f077a18598b976 (diff) | |
download | effi-reg-13876d39226b7c1b9d40a165ce9393d2a018e7f6.tar.gz |
Change: drop docs, keep yarns
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/000.yarn | 52 |
1 files changed, 52 insertions, 0 deletions
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 |