diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-04-29 19:40:03 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-04-29 19:40:03 +0300 |
commit | f1d19cee2fe0ee953e8652357907029fac3939ae (patch) | |
tree | 1eb3219a13d6a5d13c1c4fbbcbf1d3ce07d530c7 | |
parent | 315fbae5532c1a0bddac82b927e936e3f666ade0 (diff) | |
download | saga-poc-f1d19cee2fe0ee953e8652357907029fac3939ae.tar.gz |
Add: muck3 (changes to emphasis of regex matches)
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | muck3.yarn | 106 |
2 files changed, 107 insertions, 1 deletions
@@ -1,4 +1,4 @@ -all: muck1.pdf muck2.pdf +all: muck1.pdf muck2.pdf muck3.pdf %.pdf: %.yarn pandoc -o $@ $< \ diff --git a/muck3.yarn b/muck3.yarn new file mode 100644 index 0000000..ca43b51 --- /dev/null +++ b/muck3.yarn @@ -0,0 +1,106 @@ +--- +title: Muck acceptance tests v3 +author: Lars Wirzenius / The Ick project +... + +Introduction +============================================================================= + +Muck is a persistent in-memory JSON store with an HTTP API and +advanced access control using signed JWT access tokens. This document +presents its automated acceptance tests, using a (for now +hypothetical) language similar to the Gherkin langauge implemented by +Cucumber. + +A happy path scenario +============================================================================= + +This scenario does some basic resource management via the Muck API. + +Start Muck. This also sets up access to it for the user by getting an +access token, which will be used for all requests. + +> **given** a running Muck + +Check server status. + +> **then** there are **_0_** resources in Muck + +Create a simple resource. Remember its id. + +> **given** I am **_tomjon_** +> **when** I create a resource `{"foo": "bar"}` +> **then** there is **_1_** resource in Muck +> **and** resource id is remembered as **_ID_** +> **and** resource revision is remembered as **_REV1_** + +Retrieve the resource. + +> **when** I fetch resource _ID_ +> **then** I get `{"foo": "bar"}` +> **and** it is mine +> **and** it has revision **_REV1_** + +Make sure another user can't retreive, update, or delete the resource. + +> **given** I am **_verence_** +> **when** I fetch resource **_ID_** +> **then** it doesn't exist +> +> **when** I update **_ID_**, revision **_REV1_**, with `{"foo": "somethingelse"}` +> **then** it doesn't exist +> +> **when** I delete **_ID_** +> **then** it doesn't exist + +Update the resource. + +> **given** I am **_tomjon_** +> **when** I update **_ID_**, revision **_wrong_**, with `{"foo": "somethingelse"}` +> **then** it doesnt't work +> +> **when** I update **_ID_**, revision **_REV1_**, with `{"foo": "somethingelse"}` +> **then** it works +> **and** resource revision is remembered as **_REV2_** + +Check the resource has been updated. + +> **when** I fetch resource **_ID_** +> **then** I get `{"foo": "somethingelse"}` +> **and** it is mine +> **and** it has revision **_REV2_** + +Restart Muck. The resource should still exist. + +> **when** Muck is restarted +> **and** I fetch resource **_ID_** +> **then** I get `{"foo": "somethingelse"}` +> **and** it is mine +> **and** it has revision **_REV2_** + +Search for the resource. First with a condition that is no longer +true. + +> **when** I search for **_foo_** being **_bar_** +> **then** there are no matches + +Now search for the correct value. + +> **when** I search for **_foo_** being **_somethingelse_** +> **then** I get only resource **_ID_** + +Delete the resource. + +> **when** I delete **_ID_** +> **then** it works + +> **when** I fetch resource **_ID_** +> **then** it doesn't exist + +Restart Muck again. The resource should not exist. + +> **when** Muck is restarted +> **when** I fetch resource **_ID_ ** +> **then** it doesn't exist + +All done. |