From 09f244bc627db5ab5e809eb16abbfc68ecccf799 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 29 Jan 2018 14:39:08 +0100 Subject: [PATCH] backend unit test for the try to define loginUrl --- services/auth/server/boot/specs/routes.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/auth/server/boot/specs/routes.spec.js b/services/auth/server/boot/specs/routes.spec.js index 796d44bf08..afe562a4cf 100644 --- a/services/auth/server/boot/specs/routes.spec.js +++ b/services/auth/server/boot/specs/routes.spec.js @@ -35,6 +35,17 @@ describe('Auth routes', () => { }; 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', () => {