SHARE
TWEET

Untitled

a guest Mar 25th, 2019 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('Test User Registration', () => {
  2.   it('Should register a user and return user object', (done) => {
  3.     const user = {
  4.       username: 'kaykay',
  5.       email: 'kayode.okunlade@andela.com',
  6.       password: 'itsasecret'
  7.     };
  8.     request(app)
  9.       .post('api/users')
  10.       .send(user)      
  11.       .end((err, res) => {
  12.         expect(res).to.have.status(201);
  13.         expect(res.body).to.be.an('object');
  14.         expect(res.body).to.have.property('user');
  15.         expect(res.body.user).to.have.property('username')
  16.           .to.be.equal('kaykay');
  17.         expect(res.body.user).to.have.property('email')
  18.           .to.be.equal('kayode.okunlade@andela.com');
  19.         expect(res.body.user).to.have.property('password')
  20.           .to.be.equal('itsasecret');
  21.       });
  22.     done();
  23.   });
  24. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top