Last active
July 24, 2018 15:02
-
-
Save Oloyedesinmiloluwa/766266129741ecf68bf4957b6227f7ff to your computer and use it in GitHub Desktop.
Fargo Team TDD activity - Sinmiloluwa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test for creating an Article | |
describe('POST ARTICLE', () => { | |
it('It should not create article if description is missing', (done) => { | |
chai.request(userRoute) | |
.post('/api/articles') | |
.send({ | |
title: 'First Article', description: '', body: 'This is the first article so you should not expect a full article but gibberish' | |
}) | |
.end((err, res) => { | |
res.should.have.status(400); | |
res.body.errors[0].should.be.eql('Description field cannot be empty'); | |
done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clear and concise test structure, good job testing for that edge case when posting an article