Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it('it should return 404 if no teams are found', done => {
- const route = '/v1/teams'
- /*
- * Using Sinon to mock the response from the controller.
- * We want the controller decoupled from this test. We'll integrate them later.
- /*
- sandbox.stub(teams, 'getAllTeams').returns([])
- chai
- .request(app)
- .get(route)
- .end((err, res) => {
- if (err) done(err)
- /*
- * We still want to see the structure in our contract
- */
- expect(res).to.haveOwnProperty('status')
- expect(res).to.haveOwnProperty('body')
- /*
- * But we want a 404 response if no data is found
- */
- expect(res.status).to.equal(404)
- done()
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement