Advertisement
Guest User

Untitled

a guest
Jan 10th, 2019
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. describe('Post Contact',()=>{
  2. it('it should post a contact with a customer',(done)=>{
  3. chai.request(app)
  4. .post('/api/contact')
  5. .send({
  6. "contacts":
  7. [{
  8. "firstName": "Karel",
  9. "lastName": "de Grote",
  10. "title": "CEO",
  11. "email": "karel@gmail.com",
  12. "customerId": 1
  13. },
  14. {
  15. "firstName": "Hans",
  16. "lastName": "Bananenschil",
  17. "title": "CEO",
  18. "email": "hansb@gmail.com",
  19. "customerId": 1
  20. }]
  21. })
  22. .end((err,res)=>{
  23. res.should.have.status(200)
  24. res.body.should.be.a('object')
  25. // res.body.should.have.property('firstName').eql('Karel')
  26. // res.body.should.have.property('lastName').eql('de Grote')
  27. // res.body.should.have.property('title').eql('CEO')
  28. // res.body.should.have.property('email').eql('karel@gmail.com')
  29. // res.body.should.have.property('customer').be.a('object')
  30. done()
  31. })
  32. })
  33. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement