diff options
| author | Hafeez | 2018-04-13 16:58:54 +0100 |
|---|---|---|
| committer | Hafeez | 2018-04-13 16:58:54 +0100 |
| commit | c9a2859c4f3140e12ff68e6048a3c422f656ef74 (patch) | |
| tree | eb8c4e402a8478577c778c2eccab7533c1516fd3 /test/integration | |
| parent | prevent 404 on params (diff) | |
| parent | fixed template matching in test suite (diff) | |
| download | medicine-c9a2859c4f3140e12ff68e6048a3c422f656ef74.tar.gz medicine-c9a2859c4f3140e12ff68e6048a3c422f656ef74.zip | |
Merge branch ‘trh/gets’ of gitlab.cs.st-andrews.ac.uk:cs3099group-be-4/project-code into trh/gets
Diffstat (limited to 'test/integration')
| -rw-r--r-- | test/integration/protocol.routes.test.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/integration/protocol.routes.test.ts b/test/integration/protocol.routes.test.ts index 866ac2a..ebe18c2 100644 --- a/test/integration/protocol.routes.test.ts +++ b/test/integration/protocol.routes.test.ts @@ -266,14 +266,14 @@ describe('routes : protocol', () => { }); }); forEach(completeProtocol).it( - '%s %s should conform to the general response protocol', + '%s %s should conform to the general response template', (method: string, path: string, temp: Template, resCode: number) => { const request: ChaiHttp.Request = method === 'get' ? chai.request(app).get(base + path) : chai.request(app).post(base + path); request.set('Authorization', `Bearer ${token}`); return request.then((res: ChaiHttp.Response) => { - match(responseTemplate, JSON.parse(res.body)).shoul.be.true; + expect(match(responseTemplate)(res.body)).to.be.true; }); }); forEach(completeProtocol).it( @@ -284,7 +284,7 @@ describe('routes : protocol', () => { .get(base + path) .set('Authorization', `Bearer ${token}`) .then((res: ChaiHttp.Response) => { - expect(match(temp)(JSON.parse(res.body))).to.be.true; + expect(match(temp)(res.body)).to.be.true; }); } else { return true; |
