Bug 28370: Rewrite tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 21 May 2021 20:05:27 +0000 (17:05 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 25 May 2021 07:28:18 +0000 (09:28 +0200)
commit65927d0acb8f8c415e922707c6ebbdd8a4dfda04
tree80fa6f1c66f29b5c967cb612a00c217704b48e9b
parent49ce9d97263a89c8746fa2488b17932984280442
Bug 28370: Rewrite tests

This patch rewrites the tests, and also doesn't enforce
additionalProperties to be false. We could need it, and there are routes
that need to be reviewed that would break otherwise now: error.json, for
example, is used everywhere, and some routes add some payload to it.

The main change this patch introduces is using the resolved spec instead
of finding each .json file, which wasn't even correct as we have .yaml
files already. Parameters and responses are tested.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove xt/api.t
=> SUCCESS: Tests fail! A nice report on the failures is printed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
xt/api.t