Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Post Contact',()=>{
- it('it should post a contact with a customer',(done)=>{
- chai.request(app)
- .post('/api/contact')
- .send({
- "contacts":
- [{
- "firstName": "Karel",
- "lastName": "de Grote",
- "title": "CEO",
- "email": "karel@gmail.com",
- "customerId": 1
- },
- {
- "firstName": "Hans",
- "lastName": "Bananenschil",
- "title": "CEO",
- "email": "hansb@gmail.com",
- "customerId": 1
- }]
- })
- .end((err,res)=>{
- res.should.have.status(200)
- res.body.should.be.a('object')
- // res.body.should.have.property('firstName').eql('Karel')
- // res.body.should.have.property('lastName').eql('de Grote')
- // res.body.should.have.property('title').eql('CEO')
- // res.body.should.have.property('email').eql('karel@gmail.com')
- // res.body.should.have.property('customer').be.a('object')
- done()
- })
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement