aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/friends-basic.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-14 20:45:00 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commita4254ea1738d3b963fd4ccb995ab63f70656d6c0 (patch)
tree5b86f5111b9ff764e41285198c15b5c24d4648f4 /server/tests/api/friends-basic.js
parent49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed (diff)
downloadPeerTube-a4254ea1738d3b963fd4ccb995ab63f70656d6c0.tar.gz
PeerTube-a4254ea1738d3b963fd4ccb995ab63f70656d6c0.tar.zst
PeerTube-a4254ea1738d3b963fd4ccb995ab63f70656d6c0.zip
Server: adapt tests to host
Diffstat (limited to 'server/tests/api/friends-basic.js')
-rw-r--r--server/tests/api/friends-basic.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/api/friends-basic.js b/server/tests/api/friends-basic.js
index f1393b5ec..a871f9838 100644
--- a/server/tests/api/friends-basic.js
+++ b/server/tests/api/friends-basic.js
@@ -22,7 +22,7 @@ describe('Test basic friends', function () {
22 const friends = [] 22 const friends = []
23 for (let i = 0; i < servers.length; i++) { 23 for (let i = 0; i < servers.length; i++) {
24 if (servers[i].url === serverToTest.url) continue 24 if (servers[i].url === serverToTest.url) continue
25 friends.push(servers[i].url) 25 friends.push(servers[i].host)
26 } 26 }
27 27
28 podsUtils.getFriendsList(serverToTest.url, function (err, res) { 28 podsUtils.getFriendsList(serverToTest.url, function (err, res) {
@@ -32,12 +32,12 @@ describe('Test basic friends', function () {
32 expect(result).to.be.an('array') 32 expect(result).to.be.an('array')
33 expect(result.length).to.equal(2) 33 expect(result.length).to.equal(2)
34 34
35 const resultUrls = [ result[0].url, result[1].url ] 35 const resultHosts = [ result[0].host, result[1].host ]
36 expect(resultUrls[0]).to.not.equal(resultUrls[1]) 36 expect(resultHosts[0]).to.not.equal(resultHosts[1])
37 37
38 const errorString = 'Friends url do not correspond for ' + serverToTest.url 38 const errorString = 'Friends host do not correspond for ' + serverToTest.host
39 expect(friends).to.contain(resultUrls[0], errorString) 39 expect(friends).to.contain(resultHosts[0], errorString)
40 expect(friends).to.contain(resultUrls[1], errorString) 40 expect(friends).to.contain(resultHosts[1], errorString)
41 callback() 41 callback()
42 }) 42 })
43 } 43 }
@@ -95,7 +95,7 @@ describe('Test basic friends', function () {
95 expect(result.length).to.equal(1) 95 expect(result.length).to.equal(1)
96 96
97 const pod = result[0] 97 const pod = result[0]
98 expect(pod.url).to.equal(servers[2].url) 98 expect(pod.host).to.equal(servers[2].host)
99 expect(pod.score).to.equal(20) 99 expect(pod.score).to.equal(20)
100 expect(miscsUtils.dateIsValid(pod.createdDate)).to.be.true 100 expect(miscsUtils.dateIsValid(pod.createdDate)).to.be.true
101 101
@@ -112,7 +112,7 @@ describe('Test basic friends', function () {
112 expect(result.length).to.equal(1) 112 expect(result.length).to.equal(1)
113 113
114 const pod = result[0] 114 const pod = result[0]
115 expect(pod.url).to.equal(servers[1].url) 115 expect(pod.host).to.equal(servers[1].host)
116 expect(pod.score).to.equal(20) 116 expect(pod.score).to.equal(20)
117 expect(miscsUtils.dateIsValid(pod.createdDate)).to.be.true 117 expect(miscsUtils.dateIsValid(pod.createdDate)).to.be.true
118 118
@@ -170,7 +170,7 @@ describe('Test basic friends', function () {
170 const result = res.body 170 const result = res.body
171 expect(result).to.be.an('array') 171 expect(result).to.be.an('array')
172 expect(result.length).to.equal(1) 172 expect(result.length).to.equal(1)
173 expect(result[0].url).not.to.be.equal(servers[1].url) 173 expect(result[0].host).not.to.be.equal(servers[1].host)
174 callback() 174 callback()
175 }) 175 })
176 }, next) 176 }, next)