From 1e904cde34ba41a16256da1073336dd652368592 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 2 Jul 2020 14:23:50 +0200 Subject: [PATCH] Fix users tests --- config/test.yaml | 4 ++-- server/controllers/api/users/index.ts | 2 +- shared/extra-utils/users/users.ts | 2 +- support/doc/api/openapi.yaml | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/test.yaml b/config/test.yaml index 8e887407e..fb37ff8c7 100644 --- a/config/test.yaml +++ b/config/test.yaml @@ -87,8 +87,8 @@ import: http: enabled: true proxy: - enabled: true - url: "http://188.165.225.149:7899" + enabled: false + url: "" torrent: enabled: true diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 732a6faa3..c8e9eaeaa 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -205,7 +205,7 @@ async function createUser (req: express.Request, res: express.Response) { Hooks.runAction('action:api.user.created', { body, user, account, videoChannel }) - return res.status(201).json({ + return res.json({ user: { id: user.id, account: { diff --git a/shared/extra-utils/users/users.ts b/shared/extra-utils/users/users.ts index 766189dfe..08b7743a6 100644 --- a/shared/extra-utils/users/users.ts +++ b/shared/extra-utils/users/users.ts @@ -29,7 +29,7 @@ function createUser (parameters: CreateUserArgs) { videoQuota = 1000000, videoQuotaDaily = -1, role = UserRole.USER, - specialStatus = 201 + specialStatus = 200 } = parameters const path = '/api/v1/users' diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 186d7d37d..eec4e0248 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -53,7 +53,7 @@ externalDocs: tags: - name: Accounts description: > - Accounts encompass remote accounts discovered across the federation, + Accounts encompass remote accounts discovered across the federation, and correspond to the main Actor, along with video channels a user can create, which are also Actors. @@ -484,7 +484,7 @@ paths: tags: - Users responses: - '201': + '200': description: user created content: application/json: @@ -3879,11 +3879,11 @@ components: files: type: array items: - $ref: '#/components/schemas/FileRedundancyInformation' + $ref: '#/components/schemas/FileRedundancyInformation' streamingPlaylists: type: array items: - $ref: '#/components/schemas/FileRedundancyInformation' + $ref: '#/components/schemas/FileRedundancyInformation' VideoImportStateConstant: properties: id: @@ -5265,4 +5265,4 @@ components: content: application/json: schema: - $ref: '#/components/schemas/VideoListResponse' \ No newline at end of file + $ref: '#/components/schemas/VideoListResponse'