diff --git a/seasoned_api/test/system/asADeveloperIWantToLogin.js b/seasoned_api/test/system/asADeveloperIWantToLogin.js index 3a48e7a..c769c29 100644 --- a/seasoned_api/test/system/asADeveloperIWantToLogin.js +++ b/seasoned_api/test/system/asADeveloperIWantToLogin.js @@ -5,8 +5,10 @@ const createUser = require('test/helpers/createUser'); const resetDatabase = require('test/helpers/resetDatabase'); describe('As a user I want to log in', () => { - before(() => resetDatabase()); - before(() => createUser('test_user', 'test@gmail.com', 'password')); + before(() => { + return resetDatabase() + .then(() => createUser('test_user', 'password')) + }) it('should return 200 with a token if correct credentials are given', () => request(app) diff --git a/seasoned_api/test/system/asAUserIWantToRequestAMovie.js b/seasoned_api/test/system/asAUserIWantToRequestAMovie.js index f51c085..d78ceb4 100644 --- a/seasoned_api/test/system/asAUserIWantToRequestAMovie.js +++ b/seasoned_api/test/system/asAUserIWantToRequestAMovie.js @@ -5,8 +5,10 @@ const createUser = require('test/helpers/createUser'); const createToken = require('test/helpers/createToken'); describe('As a user I want to request a movie', () => { - before(() => resetDatabase()); - before(() => createUser('test_user', 'test@gmail.com', 'password')); + before(() => { + return resetDatabase() + .then(() => createUser('test_user', 'test@gmail.com', 'password')); + }) it('should return 200 when item is requested', () => request(app)