From bfaa0344677a291e5c698aa685b02e9b9250c8f2 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Sun, 25 Feb 2018 04:59:55 +0000 Subject: [PATCH] Fixed tests --- config/routes/auth.js | 2 +- test/auth.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/routes/auth.js b/config/routes/auth.js index d72221b..78b00f6 100755 --- a/config/routes/auth.js +++ b/config/routes/auth.js @@ -135,7 +135,7 @@ module.exports = (app, passport) => { if (!mw.validateEmail(req.body.email)) { debug(`Email ${req.body.email} was found invalid!`) req.flash('warning', `The email you entered, ${req.body.email} isn't valid. Try again. `) - res.redirect('/login#login') + res.redirect('/login#signup') next() // Valid email diff --git a/test/auth.js b/test/auth.js index 72b7a87..094aa97 100755 --- a/test/auth.js +++ b/test/auth.js @@ -38,10 +38,10 @@ describe('Authentication', () => { ).to.redirectTo('/login#signup') /* Ensure user was deleted after email failed to send - /* Users with bad emails are removed asynchronously and may happen after - /* the response was recieved. Ensure it's happened in a kludgy way by - /* waiting 2 seconds before asserting that the user doesn't exist - */ + * Users with bad emails are removed asynchronously and may happen after + * the response was recieved. Ensure it's happened in a kludgy way by + * waiting 2 seconds before asserting that the user doesn't exist + */ setTimeout( async () => { chai.assert.isNull( await User.findOne({ 'email': FAKE_EMAIL @@ -61,10 +61,10 @@ describe('Authentication', () => { ).to.redirectTo('/login#signup') /* Ensure user was deleted after email failed to send - /* Users with bad emails are removed asynchronously and may happen after - /* the response was recieved. Ensure it's happened in a kludgy way by - /* waiting 2 seconds before asserting that the user doesn't exist - */ + * Users with bad emails are removed asynchronously and may happen after + * the response was recieved. Ensure it's happened in a kludgy way by + * waiting 2 seconds before asserting that the user doesn't exist + */ setTimeout( async () => { chai.assert.isNull( await User.findOne({ 'email': fuzzed_email @@ -159,7 +159,7 @@ describe('Authentication', () => { }) - it.skip('Loads forgot password page', async () => { + it('Loads forgot password page', async () => { let res = await request.get('/login/forgot') chai.expect(res).html.to.have.status(200) })