diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 11:55:31 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 11:55:31 +0100 |
commit | b09ce6455f8e2bf9dd741532e6ad09309880ff74 (patch) | |
tree | 7d2ec942e50b8f3347ed4287e07e2bc88619e585 /server/tests/utils/requests.js | |
parent | 0d4fb7e6d482635cd725cd2f09cf981f82cbd92c (diff) | |
download | PeerTube-b09ce6455f8e2bf9dd741532e6ad09309880ff74.tar.gz PeerTube-b09ce6455f8e2bf9dd741532e6ad09309880ff74.tar.zst PeerTube-b09ce6455f8e2bf9dd741532e6ad09309880ff74.zip |
Server: error if we add a pod that already exists
Diffstat (limited to 'server/tests/utils/requests.js')
-rw-r--r-- | server/tests/utils/requests.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/tests/utils/requests.js b/server/tests/utils/requests.js index b1470814d..84cf3483f 100644 --- a/server/tests/utils/requests.js +++ b/server/tests/utils/requests.js | |||
@@ -36,7 +36,8 @@ function makePostUploadRequest (url, path, token, fields, attaches, done, status | |||
36 | req.attach(attach, value) | 36 | req.attach(attach, value) |
37 | }) | 37 | }) |
38 | 38 | ||
39 | req.expect(statusCodeExpected, done) | 39 | req.expect(statusCodeExpected) |
40 | .end(done) | ||
40 | } | 41 | } |
41 | 42 | ||
42 | function makePostBodyRequest (url, path, token, fields, done, statusCodeExpected) { | 43 | function makePostBodyRequest (url, path, token, fields, done, statusCodeExpected) { |
@@ -48,7 +49,9 @@ function makePostBodyRequest (url, path, token, fields, done, statusCodeExpected | |||
48 | 49 | ||
49 | if (token) req.set('Authorization', 'Bearer ' + token) | 50 | if (token) req.set('Authorization', 'Bearer ' + token) |
50 | 51 | ||
51 | req.send(fields).expect(statusCodeExpected, done) | 52 | req.send(fields) |
53 | .expect(statusCodeExpected) | ||
54 | .end(done) | ||
52 | } | 55 | } |
53 | 56 | ||
54 | function makePutBodyRequest (url, path, token, fields, done, statusCodeExpected) { | 57 | function makePutBodyRequest (url, path, token, fields, done, statusCodeExpected) { |
@@ -60,7 +63,9 @@ function makePutBodyRequest (url, path, token, fields, done, statusCodeExpected) | |||
60 | 63 | ||
61 | if (token) req.set('Authorization', 'Bearer ' + token) | 64 | if (token) req.set('Authorization', 'Bearer ' + token) |
62 | 65 | ||
63 | req.send(fields).expect(statusCodeExpected, done) | 66 | req.send(fields) |
67 | .expect(statusCodeExpected) | ||
68 | .end(done) | ||
64 | } | 69 | } |
65 | 70 | ||
66 | // --------------------------------------------------------------------------- | 71 | // --------------------------------------------------------------------------- |