aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2015-12-05 10:28:27 +0100
committerChocobozzz <florian.bigard@gmail.com>2015-12-07 17:22:36 +0100
commit4d5f813870683c29af6b9959efa9fd4c4ea5e3b7 (patch)
treea4bf8e928e7adc8090b28218ca58677fe49e160e /test
parent19f358b4c0ad726547f9eea9178b3ff929f0fd8f (diff)
downloadPeerTube-4d5f813870683c29af6b9959efa9fd4c4ea5e3b7.tar.gz
PeerTube-4d5f813870683c29af6b9959efa9fd4c4ea5e3b7.tar.zst
PeerTube-4d5f813870683c29af6b9959efa9fd4c4ea5e3b7.zip
Add tests for searching a video
Diffstat (limited to 'test')
-rw-r--r--test/api/singlePod.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/api/singlePod.js b/test/api/singlePod.js
index bc9243c1c..301065f39 100644
--- a/test/api/singlePod.js
+++ b/test/api/singlePod.js
@@ -92,6 +92,44 @@
92 }) 92 })
93 }) 93 })
94 94
95 it('Should search the video', function (done) {
96 request(url)
97 .get(path + '/search/my')
98 .set('Accept', 'application/json')
99 .expect(200)
100 .expect('Content-Type', /json/)
101 .end(function (err, res) {
102 if (err) throw err
103
104 expect(res.body).to.be.an('array')
105 expect(res.body.length).to.equal(1)
106
107 var video = res.body[0]
108 expect(video.name).to.equal('my super name')
109 expect(video.description).to.equal('my super description')
110 expect(video.podUrl).to.equal('http://localhost:9001')
111 expect(video.magnetUri).to.exist
112
113 done()
114 })
115 })
116
117 it('Should not find a search', function (done) {
118 request(url)
119 .get(path + '/search/hello')
120 .set('Accept', 'application/json')
121 .expect(200)
122 .expect('Content-Type', /json/)
123 .end(function (err, res) {
124 if (err) throw err
125
126 expect(res.body).to.be.an('array')
127 expect(res.body.length).to.equal(0)
128
129 done()
130 })
131 })
132
95 it('Should remove the video', function (done) { 133 it('Should remove the video', function (done) {
96 request(url) 134 request(url)
97 .delete(path + '/' + video_id) 135 .delete(path + '/' + video_id)