let videoId: string
before(async function () {
- this.timeout(30000)
+ this.timeout(60000)
const config = {
rates_limit: {
})
it('Should view a video only once with the same IP by default', async function () {
- this.timeout(20000)
+ this.timeout(40000)
await server.views.simulateView({ id: videoId })
await server.views.simulateView({ id: videoId })
it('Should rate limit signup', async function () {
for (let i = 0; i < 10; i++) {
try {
- await server.users.register({ username: 'test' + i })
+ await server.registrations.register({ username: 'test' + i })
} catch {
// empty
}
}
- await server.users.register({ username: 'test42', expectedStatus: HttpStatusCode.TOO_MANY_REQUESTS_429 })
+ await server.registrations.register({ username: 'test42', expectedStatus: HttpStatusCode.TOO_MANY_REQUESTS_429 })
})
it('Should not rate limit failed signup', async function () {
await wait(7000)
for (let i = 0; i < 3; i++) {
- await server.users.register({ username: 'test' + i, expectedStatus: HttpStatusCode.CONFLICT_409 })
+ await server.registrations.register({ username: 'test' + i, expectedStatus: HttpStatusCode.CONFLICT_409 })
}
- await server.users.register({ username: 'test43', expectedStatus: HttpStatusCode.NO_CONTENT_204 })
+ await server.registrations.register({ username: 'test43', expectedStatus: HttpStatusCode.NO_CONTENT_204 })
})