diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-03-08 21:35:43 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-03-08 21:35:43 +0100 |
commit | d38b82810638b9f664c9016fac2684454c273a77 (patch) | |
tree | 9465c367e5033675309efca4d66790c6fdd5230d /server/tests/api/single-pod.js | |
parent | 8f9064432122cba0f518a24ac4378357dadec589 (diff) | |
download | PeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.gz PeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.zst PeerTube-d38b82810638b9f664c9016fac2684454c273a77.zip |
Add like/dislike system for videos
Diffstat (limited to 'server/tests/api/single-pod.js')
-rw-r--r-- | server/tests/api/single-pod.js | 34 |
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 | ||