Added test for checking popular shows list in tmdb.

This commit is contained in:
2018-02-07 14:35:36 +01:00
parent 1be8bc0319
commit bd1e3c4455
2 changed files with 19 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
const assert = require('assert');
const createCacheEntry = require('test/helpers/createCacheEntry');
const resetDatabase = require('test/helpers/resetDatabase');
const request = require('supertest-as-promised');
const app = require('src/webserver/app');
const popularShowsSuccess = require('test/fixtures/popular-show-success-response.json');
describe('As a user I want to get popular shows', () => {
before(() => resetDatabase());
before(() => createCacheEntry('p:show::1', popularShowsSuccess));
it('should return 200 with the information', () =>
request(app)
.get('/api/v1/tmdb/list/popular?type=show')
.expect(200)
.then(response => assert.equal(response.body.results.length, 20))
);
});