This commit is contained in:
Tyrel Souza 2017-11-29 23:18:47 -05:00
parent 9c7041a80f
commit 27ae801067

View File

@ -10,7 +10,8 @@ beforeEach((done) => {
describe('POST /todos', () => {
it('should create a new todo', (done) => {
var text = 'X GON GIVE IT TO YA';
var text = 'Test todo text';
request(app)
.post('/todos')
.send({text})
@ -20,16 +21,14 @@ describe('POST /todos', () => {
})
.end((err, res) => {
if (err) {
console.log(err);
return done(err);
}
Todo.find().then((todos) => {
expect(todos.length).toBe(1);
expect(todos[0].text).toBe(text);
})
done();
}).catch((err) => done(err))
})
}).catch((e) => done(e));
});
});