More unit tests for checking correct definition of movie. Changed some test to match update functions in tmdb.

This commit is contained in:
2018-10-30 20:32:55 +01:00
parent 5a48158f07
commit 7e46d32e30
9 changed files with 80 additions and 7 deletions

View File

@@ -2,15 +2,15 @@ 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 interstellarQuerySuccess = require('test/fixtures/interstellar-query-success-response.json');
const interstellarQuerySuccess = require('test/fixtures/interstellar-query-movie-success-response.json');
describe('As an anonymous user I want to search for a movie', () => {
before(() => resetDatabase());
before(() => createCacheEntry('se:1:multi:interstellar', interstellarQuerySuccess));
before(() => createCacheEntry('mose:1:interstellar', interstellarQuerySuccess));
it('should return 200 with the search results even if user is not logged in', () =>
request(app)
.get('/api/v1/tmdb/search?query=interstellar&page=1')
.get('/api/v2/search/movie?query=interstellar&page=1')
.expect(200)
);
});