import 'mocha'
import {
+ cleanupTests,
createUser,
doubleFollow,
flushAndRunMultipleServers,
it('Should fail with an invalid token', async function () {
await makePutBodyRequest({
url: servers[0].url,
- path: path + '/localhost:9002',
+ path: path + '/localhost:' + servers[1].port,
fields: { redundancyAllowed: true },
token: 'fake_token',
statusCodeExpected: 401
it('Should fail if the user is not an administrator', async function () {
await makePutBodyRequest({
url: servers[0].url,
- path: path + '/localhost:9002',
+ path: path + '/localhost:' + servers[1].port,
fields: { redundancyAllowed: true },
token: userAccessToken,
statusCodeExpected: 403
it('Should fail without de redundancyAllowed param', async function () {
await makePutBodyRequest({
url: servers[0].url,
- path: path + '/localhost:9002',
+ path: path + '/localhost:' + servers[1].port,
fields: { blabla: true },
token: servers[0].accessToken,
statusCodeExpected: 400
it('Should succeed with the correct parameters', async function () {
await makePutBodyRequest({
url: servers[0].url,
- path: path + '/localhost:9002',
+ path: path + '/localhost:' + servers[1].port,
fields: { redundancyAllowed: true },
token: servers[0].accessToken,
statusCodeExpected: 204
})
})
- after(function () {
- killallServers(servers)
+ after(async function () {
+ await cleanupTests(servers)
})
})