diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/api/singlePod.js | 38 |
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) |