diff options
Diffstat (limited to 'server/tests/api/single-pod.js')
-rw-r--r-- | server/tests/api/single-pod.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/server/tests/api/single-pod.js b/server/tests/api/single-pod.js index 9465f6034..6d7ebdc9b 100644 --- a/server/tests/api/single-pod.js +++ b/server/tests/api/single-pod.js | |||
@@ -57,6 +57,19 @@ describe('Test a single pod', function () { | |||
57 | }) | 57 | }) |
58 | }) | 58 | }) |
59 | 59 | ||
60 | it('Should list video licences', function (done) { | ||
61 | videosUtils.getVideoLicences(server.url, function (err, res) { | ||
62 | if (err) throw err | ||
63 | |||
64 | const licences = res.body | ||
65 | expect(Object.keys(licences)).to.have.length.above(5) | ||
66 | |||
67 | expect(licences[3]).to.equal('Attribution - No Derivatives') | ||
68 | |||
69 | done() | ||
70 | }) | ||
71 | }) | ||
72 | |||
60 | it('Should not have videos', function (done) { | 73 | it('Should not have videos', function (done) { |
61 | videosUtils.getVideosList(server.url, function (err, res) { | 74 | videosUtils.getVideosList(server.url, function (err, res) { |
62 | if (err) throw err | 75 | if (err) throw err |
@@ -73,6 +86,7 @@ describe('Test a single pod', function () { | |||
73 | const videoAttributes = { | 86 | const videoAttributes = { |
74 | name: 'my super name', | 87 | name: 'my super name', |
75 | category: 2, | 88 | category: 2, |
89 | licence: 6, | ||
76 | tags: [ 'tag1', 'tag2', 'tag3' ] | 90 | tags: [ 'tag1', 'tag2', 'tag3' ] |
77 | } | 91 | } |
78 | videosUtils.uploadVideo(server.url, server.accessToken, videoAttributes, done) | 92 | videosUtils.uploadVideo(server.url, server.accessToken, videoAttributes, done) |
@@ -93,6 +107,8 @@ describe('Test a single pod', function () { | |||
93 | expect(video.name).to.equal('my super name') | 107 | expect(video.name).to.equal('my super name') |
94 | expect(video.category).to.equal(2) | 108 | expect(video.category).to.equal(2) |
95 | expect(video.categoryLabel).to.equal('Films') | 109 | expect(video.categoryLabel).to.equal('Films') |
110 | expect(video.licence).to.equal(6) | ||
111 | expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives') | ||
96 | expect(video.description).to.equal('my super description') | 112 | expect(video.description).to.equal('my super description') |
97 | expect(video.podHost).to.equal('localhost:9001') | 113 | expect(video.podHost).to.equal('localhost:9001') |
98 | expect(video.magnetUri).to.exist | 114 | expect(video.magnetUri).to.exist |
@@ -130,6 +146,8 @@ describe('Test a single pod', function () { | |||
130 | expect(video.name).to.equal('my super name') | 146 | expect(video.name).to.equal('my super name') |
131 | expect(video.category).to.equal(2) | 147 | expect(video.category).to.equal(2) |
132 | expect(video.categoryLabel).to.equal('Films') | 148 | expect(video.categoryLabel).to.equal('Films') |
149 | expect(video.licence).to.equal(6) | ||
150 | expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives') | ||
133 | expect(video.description).to.equal('my super description') | 151 | expect(video.description).to.equal('my super description') |
134 | expect(video.podHost).to.equal('localhost:9001') | 152 | expect(video.podHost).to.equal('localhost:9001') |
135 | expect(video.magnetUri).to.exist | 153 | expect(video.magnetUri).to.exist |
@@ -171,6 +189,8 @@ describe('Test a single pod', function () { | |||
171 | expect(video.name).to.equal('my super name') | 189 | expect(video.name).to.equal('my super name') |
172 | expect(video.category).to.equal(2) | 190 | expect(video.category).to.equal(2) |
173 | expect(video.categoryLabel).to.equal('Films') | 191 | expect(video.categoryLabel).to.equal('Films') |
192 | expect(video.licence).to.equal(6) | ||
193 | expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives') | ||
174 | expect(video.description).to.equal('my super description') | 194 | expect(video.description).to.equal('my super description') |
175 | expect(video.podHost).to.equal('localhost:9001') | 195 | expect(video.podHost).to.equal('localhost:9001') |
176 | expect(video.author).to.equal('root') | 196 | expect(video.author).to.equal('root') |
@@ -228,6 +248,8 @@ describe('Test a single pod', function () { | |||
228 | expect(video.name).to.equal('my super name') | 248 | expect(video.name).to.equal('my super name') |
229 | expect(video.category).to.equal(2) | 249 | expect(video.category).to.equal(2) |
230 | expect(video.categoryLabel).to.equal('Films') | 250 | expect(video.categoryLabel).to.equal('Films') |
251 | expect(video.licence).to.equal(6) | ||
252 | expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives') | ||
231 | expect(video.description).to.equal('my super description') | 253 | expect(video.description).to.equal('my super description') |
232 | expect(video.podHost).to.equal('localhost:9001') | 254 | expect(video.podHost).to.equal('localhost:9001') |
233 | expect(video.author).to.equal('root') | 255 | expect(video.author).to.equal('root') |
@@ -324,6 +346,7 @@ describe('Test a single pod', function () { | |||
324 | name: video + ' name', | 346 | name: video + ' name', |
325 | description: video + ' description', | 347 | description: video + ' description', |
326 | category: 2, | 348 | category: 2, |
349 | licence: 1, | ||
327 | tags: [ 'tag1', 'tag2', 'tag3' ], | 350 | tags: [ 'tag1', 'tag2', 'tag3' ], |
328 | fixture: video | 351 | fixture: video |
329 | } | 352 | } |
@@ -548,6 +571,7 @@ describe('Test a single pod', function () { | |||
548 | const attributes = { | 571 | const attributes = { |
549 | name: 'my super video updated', | 572 | name: 'my super video updated', |
550 | category: 4, | 573 | category: 4, |
574 | licence: 2, | ||
551 | description: 'my super description updated', | 575 | description: 'my super description updated', |
552 | tags: [ 'tagup1', 'tagup2' ] | 576 | tags: [ 'tagup1', 'tagup2' ] |
553 | } | 577 | } |
@@ -565,6 +589,8 @@ describe('Test a single pod', function () { | |||
565 | expect(video.name).to.equal('my super video updated') | 589 | expect(video.name).to.equal('my super video updated') |
566 | expect(video.category).to.equal(4) | 590 | expect(video.category).to.equal(4) |
567 | expect(video.categoryLabel).to.equal('Art') | 591 | expect(video.categoryLabel).to.equal('Art') |
592 | expect(video.licence).to.equal(2) | ||
593 | expect(video.licenceLabel).to.equal('Attribution - Share Alike') | ||
568 | expect(video.description).to.equal('my super description updated') | 594 | expect(video.description).to.equal('my super description updated') |
569 | expect(video.podHost).to.equal('localhost:9001') | 595 | expect(video.podHost).to.equal('localhost:9001') |
570 | expect(video.author).to.equal('root') | 596 | expect(video.author).to.equal('root') |
@@ -604,6 +630,8 @@ describe('Test a single pod', function () { | |||
604 | expect(video.name).to.equal('my super video updated') | 630 | expect(video.name).to.equal('my super video updated') |
605 | expect(video.category).to.equal(4) | 631 | expect(video.category).to.equal(4) |
606 | expect(video.categoryLabel).to.equal('Art') | 632 | expect(video.categoryLabel).to.equal('Art') |
633 | expect(video.licence).to.equal(2) | ||
634 | expect(video.licenceLabel).to.equal('Attribution - Share Alike') | ||
607 | expect(video.description).to.equal('my super description updated') | 635 | expect(video.description).to.equal('my super description updated') |
608 | expect(video.podHost).to.equal('localhost:9001') | 636 | expect(video.podHost).to.equal('localhost:9001') |
609 | expect(video.author).to.equal('root') | 637 | expect(video.author).to.equal('root') |
@@ -633,6 +661,8 @@ describe('Test a single pod', function () { | |||
633 | expect(video.name).to.equal('my super video updated') | 661 | expect(video.name).to.equal('my super video updated') |
634 | expect(video.category).to.equal(4) | 662 | expect(video.category).to.equal(4) |
635 | expect(video.categoryLabel).to.equal('Art') | 663 | expect(video.categoryLabel).to.equal('Art') |
664 | expect(video.licence).to.equal(2) | ||
665 | expect(video.licenceLabel).to.equal('Attribution - Share Alike') | ||
636 | expect(video.description).to.equal('hello everybody') | 666 | expect(video.description).to.equal('hello everybody') |
637 | expect(video.podHost).to.equal('localhost:9001') | 667 | expect(video.podHost).to.equal('localhost:9001') |
638 | expect(video.author).to.equal('root') | 668 | expect(video.author).to.equal('root') |