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(); | |
}); | |
}); |
Neat and satisfying, Nice work!.
Good job on your TDD, great initiative on thinking about the possible scenarios.
Clear and concise test structure, good job testing for that edge case when posting an article
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice job! Keep it up and reflect on more edge cases.