Testing #90

Merged
KevinMidboe merged 9 commits from testing into master 2018-03-19 15:28:45 +00:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit ed5d302820 - Show all commits

View File

@@ -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)

View File

@@ -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)