diff options
Diffstat (limited to 'yarns.webapp/060-validation.yarn')
-rw-r--r-- | yarns.webapp/060-validation.yarn | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/yarns.webapp/060-validation.yarn b/yarns.webapp/060-validation.yarn index 588d875..989c80b 100644 --- a/yarns.webapp/060-validation.yarn +++ b/yarns.webapp/060-validation.yarn @@ -137,30 +137,53 @@ Make sure WEBAPP handles there not being any `.lorry` files. WHEN admin makes request POST /1.0/read-configuration with dummy=value THEN response matches "has been updated" AND STATEDB is empty + WHEN admin makes request GET /1.0/list-queue + THEN response has queue set to [] Add a `.lorry` file that contains broken JSON. - GIVEN Lorry file notjson.lorry with THIS IS NOT JSON + GIVEN Lorry file CONFGIT/notjson.lorry with THIS IS NOT JSON + WHEN admin makes request POST /1.0/read-configuration with dummy=value THEN response matches "has been updated" AND STATEDB is empty + WHEN admin makes request GET /1.0/list-queue + THEN response has queue set to [] Add a `.lorry` file that is valid JSON, but is not a dict. - GIVEN Lorry file notadict.lorry with [1,2,3] + GIVEN Lorry file CONFGIT/notadict.lorry with [1,2,3] + WHEN admin makes request POST /1.0/read-configuration with dummy=value THEN response matches "has been updated" AND STATEDB is empty + WHEN admin makes request GET /1.0/list-queue + THEN response has queue set to [] Add a `.lorry` that is a dict, but doesn't map keys to dicts. - GIVEN Lorry file notadictofdicts.lorry with { "foo": 1 } + GIVEN Lorry file CONFGIT/notadictofdicts.lorry with { "foo": 1 } + WHEN admin makes request POST /1.0/read-configuration with dummy=value THEN response matches "has been updated" AND STATEDB is empty + WHEN admin makes request GET /1.0/list-queue + THEN response has queue set to [] Add a `.lorry` whose inner dict does not have a `type` field. - GIVEN Lorry file notadictofdicts.lorry with { "foo": { "bar": "yo" }} + GIVEN Lorry file CONFGIT/notype.lorry with { "foo": { "bar": "yo" }} + WHEN admin makes request POST /1.0/read-configuration with dummy=value THEN response matches "has been updated" AND STATEDB is empty + WHEN admin makes request GET /1.0/list-queue + THEN response has queue set to [] + +Add a `.lorry` that is A-OK. This should work even when there are some +broken ones too. + + GIVEN Lorry file CONFGIT/a-ok.lorry with { "foo": { "type": "git", "url": "git://example.com/foo" }} + WHEN admin makes request POST /1.0/read-configuration with dummy=value + THEN response matches "has been updated" + WHEN admin makes request GET /1.0/list-queue + THEN response has queue set to ["upstream/foo"] Clean up at the end. |