Guest User

Untitled

a guest
Sep 6th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. describe('Create comment tests', () => {
  2. before((done) => {
  3. chai
  4. .request(app)
  5. .post('/api/v1/users/auth/signup')
  6. .send({
  7. username: 'enjames',
  8. email: 'enjames@james.com',
  9. password: 'pasS1234',
  10. })
  11. .end((err, res) => {
  12. token = res.body.data.token;
  13. res.body.should.have.property('data');
  14. done();
  15. });
  16. });
  17.  
  18. it('It should return an object containing a user and a comment object', (done) => {
  19. chai
  20. .request(app)
  21. .post('/api/v1/articles/1')
  22. .set('Authorization', token)
  23. .send({
  24. content: 'Your post was not inspiring.'
  25. })
  26. .end((err, res) => {
  27. res.should.have.status(201);
  28. res.body.data.should.have.property('user');
  29. res.body.data.comment.content.should.equal('Your post was not inspiring.');
  30. done();
  31. });
  32. });
  33. });
Add Comment
Please, Sign In to add comment