aboutsummaryrefslogtreecommitdiff
path: root/test/integration/protocol.routes.test.ts
diff options
context:
space:
mode:
authorjw2552018-04-13 16:10:57 +0100
committerjw2552018-04-13 16:10:57 +0100
commitcfcce63363156b5b2a8c5b4befba4babf2266f6a (patch)
tree8771ec4e9f4587efc765496c73bdde35d8cd2bf6 /test/integration/protocol.routes.test.ts
parentfixed some privs (diff)
parentfixed mock file tests (diff)
downloadmedicine-cfcce63363156b5b2a8c5b4befba4babf2266f6a.tar.gz
medicine-cfcce63363156b5b2a8c5b4befba4babf2266f6a.zip

Merge branch ‘trh/gets’ of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-4/project-code into trh/gets

Diffstat (limited to 'test/integration/protocol.routes.test.ts')
-rw-r--r--test/integration/protocol.routes.test.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/integration/protocol.routes.test.ts b/test/integration/protocol.routes.test.ts
index 3eaafe5..906f3bd 100644
--- a/test/integration/protocol.routes.test.ts
+++ b/test/integration/protocol.routes.test.ts
@@ -8,7 +8,7 @@
import * as chai from 'chai';
const expect: Chai.ExpectStatic = chai.expect;
import { Credentials, Database, addUser, initDB, resetDB,
- Projec, addProjec } from '../test-db';
+ Projec, addProjec, Filee, addFilee } from '../test-db';
import { default as User } from '../../src/db/model/User';
// Chai-http must be imported this way:
@@ -30,6 +30,7 @@ let database: Database;
let mockUser: Credentials;
let token: string;
let mockProj: Projec;
+let mockFile: Filee;
const initDatabase = async() => {
database = initDB();
@@ -40,6 +41,7 @@ const populateDatabase = async() => {
await resetDB(database);
mockUser = await addUser(database, true);
mockProj = await addProjec(database, mockUser);
+ mockFile = await addFilee(database, mockUser);
};
const getToken = async() => {
@@ -228,9 +230,9 @@ describe('routes : protocol', () => {
['get', '/projects/mocky/properties', {
data: optional(types.anything)
}, 200],
- ['get', '/projects/mocky/files/:path', null, 200],
- ['post', '/projects/mocky/files/:id', null, 200],
- ['get', '/projects/mocky/files_by_id/:id', null, 200]
+ ['get', '/projects/mocky/files/example/path', null, 200],
+ ['post', '/projects/mocky/files/mockyfile2', null, 200],
+ ['get', '/projects/mocky/files_by_id/file1', null, 200]
];
/* tslint:enable:align */