diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-05-25 20:22:41 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-05-25 20:22:41 +0300 |
commit | 4c0f475beb0f4c445d55f46670a1b6d8dcd9b129 (patch) | |
tree | e19659e259a5e77cda5bd813f6197c7f41d43a51 /muck.md | |
parent | cfc37ea567a5024a692ba929fa2338faa7403a92 (diff) | |
download | fable-poc-4c0f475beb0f4c445d55f46670a1b6d8dcd9b129.tar.gz |
Add: first rough draft of fft-docgen
Diffstat (limited to 'muck.md')
-rw-r--r-- | muck.md | 133 |
1 files changed, 133 insertions, 0 deletions
@@ -0,0 +1,133 @@ +--- +title: Muck acceptance tests v2 +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. + +```fable +given a running Muck +``` + +Check server status. + +```fable +then there are no resources in Muck +``` + +Create a simple resource. Remember its id. + +```fable +given I am tomjon +when I create a resource {"foo": "bar"} +then there is 1 resource in Muck +and remember the resource id as ID +and remember the resource revision as REV1 +``` + +Retrieve the resource. + +```fable +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. + +```fable +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. + +```fable +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 remember the resource revision as REV2 +``` + +Check the resource has been updated. + +```fable +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. + +```fable +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. + +```fable +when I search for foo being bar +then there are no matches +``` + +Now search for the correct value. + +```fable +when I search for foo being somethingelse +then I only get resource ID +``` + +Delete the resource. + +```fable +when I delete ID +then it works +``` + + +```fable +when I fetch resource ID +then it doesn't exist +``` + +Restart Muck again. The resource should not exist. + +```fable +when Muck is restarted +and I fetch resource ID +then it doesn't exist +``` + +All done. |