backend unit test for the try to define loginUrl

This commit is contained in:
Carlos Jimenez 2018-01-29 14:39:08 +01:00
parent ea3988351c
commit 09f244bc62
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,17 @@ describe('Auth routes', () => {
}; };
loginFunction(req, res); loginFunction(req, res);
}); });
it('should define the loginUrl upon login', done => {
req.body.user = 'JessicaJones';
req.body.password = 'nightmare';
req.body.location = 'http://localhost:5000/auth/?apiKey=salix';
res.json = response => {
expect(response.loginUrl).toBeDefined();
done();
};
loginFunction(req, res);
});
}); });
describe('when the user is incorrect', () => { describe('when the user is incorrect', () => {