Fix tests
authorChocobozzz <me@florianbigard.com>
Tue, 28 Aug 2018 09:32:03 +0000 (11:32 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 28 Aug 2018 09:32:03 +0000 (11:32 +0200)
server/controllers/api/config.ts
server/lib/oauth-model.ts
server/tests/api/server/config.ts

index 3fd355e6d38e0034fc930bd539736c15bf5e9702..8dfc3deb445cba68f48c8bf691482323b27de74c 100644 (file)
@@ -161,6 +161,7 @@ async function updateCustomConfig (req: express.Request, res: express.Response,
   // camelCase to snake_case key
   const toUpdateJSON = omit(toUpdate, 'user.videoQuota', 'instance.defaultClientRoute', 'instance.shortDescription', 'cache.videoCaptions')
   toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota
+  toUpdateJSON.user['video_quota_daily'] = toUpdate.user.videoQuotaDaily
   toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute
   toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription
   toUpdateJSON.instance['default_nsfw_policy'] = toUpdate.instance.defaultNSFWPolicy
index 272e90f3a4b7305ac32a97d17bd07599629ea52e..09eaf75d1fc1e982eb80cc316803f3d40a49c749 100644 (file)
@@ -23,7 +23,6 @@ function getClient (clientId: string, clientSecret: string) {
 function getRefreshToken (refreshToken: string) {
   logger.debug('Getting RefreshToken (refreshToken: ' + refreshToken + ').')
 
-
   return OAuthTokenModel.getByRefreshTokenAndPopulateClient(refreshToken)
 }
 
index 8a5f27c34a2dbf2f5ffed47fd54d734125f77818..ece4118a69a41c661e5bcdae56b9c68083dcd6c2 100644 (file)
@@ -37,7 +37,7 @@ function checkInitialConfig (data: CustomConfig) {
   expect(data.signup.limit).to.equal(4)
   expect(data.admin.email).to.equal('admin1@example.com')
   expect(data.user.videoQuota).to.equal(5242880)
-  expect(data.user.videoQuotaDaily).to.equal(318742)
+  expect(data.user.videoQuotaDaily).to.equal(-1)
   expect(data.transcoding.enabled).to.be.false
   expect(data.transcoding.threads).to.equal(2)
   expect(data.transcoding.resolutions['240p']).to.be.true