Guest User

Untitled

a guest
Jan 18th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. const emailModel = new Email();
  2. await emailModel.sendSignupMail(user, 'en');
  3.  
  4. let email = new Email();
  5. beforeEach(() => {
  6. chai.spy.on(Template.prototype, 'load');
  7. chai.spy.on(mail, 'sendEmail', () => {});
  8. stubSendMail = sinon.stub(email, 'sendSignupMail').resolves();
  9. })
  10.  
  11. afterEach(() => {
  12. chai.spy.restore();
  13. if (stubSendMail) stubSendMail.restore();
  14. })
  15.  
  16. it('should return a 200 if success', async () => {
  17. await userLoginController.signup(req, res, next);
  18. expect(res.statusCode).to.equal(200);
  19. });
  20.  
  21. POST /v2/user/signup
  22. should return a 200 if success:
  23.  
  24. AssertionError: expected 500 to equal 200
  25. + expected - actual
  26.  
  27. -500
  28. +200
Add Comment
Please, Sign In to add comment