SHARE
TWEET

Untitled

a guest Jan 18th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
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