Started by adding some system tests for the api.

This commit is contained in:
2017-12-20 20:47:32 +01:00
parent 790f5d6588
commit 99ddb61c37
13 changed files with 629 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
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');
describe('As an anonymous user I want to search for a movie', () => {
before(() => resetDatabase());
before(() => createCacheEntry('s:1:movie: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')
.expect(200)
);
});