Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Create comment tests', () => {
- before((done) => {
- chai
- .request(app)
- .post('/api/v1/users/auth/signup')
- .send({
- username: 'enjames',
- email: 'enjames@james.com',
- password: 'pasS1234',
- })
- .end((err, res) => {
- token = res.body.data.token;
- res.body.should.have.property('data');
- done();
- });
- });
- it('It should return an object containing a user and a comment object', (done) => {
- chai
- .request(app)
- .post('/api/v1/articles/1')
- .set('Authorization', token)
- .send({
- content: 'Your post was not inspiring.'
- })
- .end((err, res) => {
- res.should.have.status(201);
- res.body.data.should.have.property('user');
- res.body.data.comment.content.should.equal('Your post was not inspiring.');
- done();
- });
- });
- });
Add Comment
Please, Sign In to add comment