aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/checkParams.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-07 22:09:59 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-07 22:09:59 +0200
commit8d30905858245f12a42fc327d2d57cbfe062d548 (patch)
tree9bd590872fbb753782f2ebbb9516db0414022d70 /server/tests/api/checkParams.js
parent58b2ba55a90f05f24661e664b1fb0a3486f037e8 (diff)
downloadPeerTube-8d30905858245f12a42fc327d2d57cbfe062d548.tar.gz
PeerTube-8d30905858245f12a42fc327d2d57cbfe062d548.tar.zst
PeerTube-8d30905858245f12a42fc327d2d57cbfe062d548.zip
Server: split tests utils in multiple files
Diffstat (limited to 'server/tests/api/checkParams.js')
-rw-r--r--server/tests/api/checkParams.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/server/tests/api/checkParams.js b/server/tests/api/checkParams.js
index e489df277..675dc19e6 100644
--- a/server/tests/api/checkParams.js
+++ b/server/tests/api/checkParams.js
@@ -6,7 +6,9 @@ const pathUtils = require('path')
6const request = require('supertest') 6const request = require('supertest')
7const series = require('async/series') 7const series = require('async/series')
8 8
9const utils = require('./utils') 9const loginUtils = require('../utils/login')
10const serversUtils = require('../utils/servers')
11const usersUtils = require('../utils/users')
10 12
11describe('Test parameters validator', function () { 13describe('Test parameters validator', function () {
12 let server = null 14 let server = null
@@ -71,17 +73,17 @@ describe('Test parameters validator', function () {
71 73
72 series([ 74 series([
73 function (next) { 75 function (next) {
74 utils.flushTests(next) 76 serversUtils.flushTests(next)
75 }, 77 },
76 function (next) { 78 function (next) {
77 utils.runServer(1, function (server1) { 79 serversUtils.runServer(1, function (server1) {
78 server = server1 80 server = server1
79 81
80 next() 82 next()
81 }) 83 })
82 }, 84 },
83 function (next) { 85 function (next) {
84 utils.loginAndGetAccessToken(server, function (err, token) { 86 loginUtils.loginAndGetAccessToken(server, function (err, token) {
85 if (err) throw err 87 if (err) throw err
86 server.accessToken = token 88 server.accessToken = token
87 89
@@ -141,13 +143,13 @@ describe('Test parameters validator', function () {
141 let userAccessToken = null 143 let userAccessToken = null
142 144
143 before(function (done) { 145 before(function (done) {
144 utils.createUser(server.url, server.accessToken, 'user1', 'password', function () { 146 usersUtils.createUser(server.url, server.accessToken, 'user1', 'password', function () {
145 server.user = { 147 server.user = {
146 username: 'user1', 148 username: 'user1',
147 password: 'password' 149 password: 'password'
148 } 150 }
149 151
150 utils.loginAndGetAccessToken(server, function (err, accessToken) { 152 loginUtils.loginAndGetAccessToken(server, function (err, accessToken) {
151 if (err) throw err 153 if (err) throw err
152 154
153 userAccessToken = accessToken 155 userAccessToken = accessToken
@@ -581,7 +583,7 @@ describe('Test parameters validator', function () {
581 password: 'my super password' 583 password: 'my super password'
582 } 584 }
583 585
584 utils.loginAndGetAccessToken(server, function (err, accessToken) { 586 loginUtils.loginAndGetAccessToken(server, function (err, accessToken) {
585 if (err) throw err 587 if (err) throw err
586 588
587 userAccessToken = accessToken 589 userAccessToken = accessToken
@@ -598,7 +600,7 @@ describe('Test parameters validator', function () {
598 600
599 describe('When updating a user', function () { 601 describe('When updating a user', function () {
600 before(function (done) { 602 before(function (done) {
601 utils.getUsersList(server.url, function (err, res) { 603 usersUtils.getUsersList(server.url, function (err, res) {
602 if (err) throw err 604 if (err) throw err
603 605
604 userId = res.body.data[1].id 606 userId = res.body.data[1].id
@@ -702,7 +704,7 @@ describe('Test parameters validator', function () {
702 704
703 // Keep the logs if the test failed 705 // Keep the logs if the test failed
704 if (this.ok) { 706 if (this.ok) {
705 utils.flushTests(done) 707 serversUtils.flushTests(done)
706 } else { 708 } else {
707 done() 709 done()
708 } 710 }