Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. it('handles a put request error', (done) => {
  2. chai.request(app)
  3. .post('/register')
  4. .send({ username: 'steve', email: 'steve@test.com', password: 'bestpassword123', password2: 'bestpassword123' })
  5. .then(() => {
  6. var agent = chai.request.agent(app)
  7. agent.post('/sign-in')
  8. .send({ username: 'steve', password: 'bestpassword123' })
  9. .then(() => {
  10. agent.put('/vi')
  11. .send('somethingbogus')
  12. .then((res) => {
  13. })
  14. .catch((err) => {
  15. console.log(err)
  16. err.should.have.status(404)
  17. err.response.error.text.should.have.string('Sorry, page not found!')
  18. done()
  19. })
  20. })
  21. })
  22. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement