aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/single-pod.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/single-pod.js')
-rw-r--r--server/tests/api/single-pod.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/server/tests/api/single-pod.js b/server/tests/api/single-pod.js
index 87d0e9a71..96e4aff9e 100644
--- a/server/tests/api/single-pod.js
+++ b/server/tests/api/single-pod.js
@@ -609,6 +609,40 @@ describe('Test a single pod', function () {
609 }) 609 })
610 }) 610 })
611 611
612 it('Should like a video', function (done) {
613 videosUtils.rateVideo(server.url, server.accessToken, videoId, 'like', function (err) {
614 if (err) throw err
615
616 videosUtils.getVideo(server.url, videoId, function (err, res) {
617 if (err) throw err
618
619 const video = res.body
620
621 expect(video.likes).to.equal(1)
622 expect(video.dislikes).to.equal(0)
623
624 done()
625 })
626 })
627 })
628
629 it('Should dislike the same video', function (done) {
630 videosUtils.rateVideo(server.url, server.accessToken, videoId, 'dislike', function (err) {
631 if (err) throw err
632
633 videosUtils.getVideo(server.url, videoId, function (err, res) {
634 if (err) throw err
635
636 const video = res.body
637
638 expect(video.likes).to.equal(0)
639 expect(video.dislikes).to.equal(1)
640
641 done()
642 })
643 })
644 })
645
612 after(function (done) { 646 after(function (done) {
613 process.kill(-server.app.pid) 647 process.kill(-server.app.pid)
614 648