From 06e2bceb0057c6ef60fe4f7916f27fc4a5ed0de7 Mon Sep 17 00:00:00 2001 From: febbweiss Date: Fri, 11 Sep 2015 09:10:53 +0000 Subject: [PATCH] Fix: test coverage --- test/autentication.service.spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/autentication.service.spec.js b/test/autentication.service.spec.js index c86f57f..06771fb 100644 --- a/test/autentication.service.spec.js +++ b/test/autentication.service.spec.js @@ -22,6 +22,7 @@ describe('AuthenticationService', function() { data.success.should.be.true; var user = data.user; + httpBackend.flush(); should.exist(user); user.username.should.be.equal('test'); user.token.should.be.equal('tok3n'); @@ -33,12 +34,13 @@ describe('AuthenticationService', function() { it('should fail to login and return message', function() { httpBackend .when('POST', 'api/users/login') - .respond(401); + .respond(401, {message: 'Authentication failed'}); AuthenticationService.login('test', 'password', function(data) { data.succes.should.be.false; var message = data.message; + httpBackend.flush(); should.exist(message); message.should.be.equal('Authentication fail');