diff --git a/project-manager/src/app/services/login-service/login.service.spec.ts b/project-manager/src/app/services/login-service/login.service.spec.ts index a52af17..9c6d013 100644 --- a/project-manager/src/app/services/login-service/login.service.spec.ts +++ b/project-manager/src/app/services/login-service/login.service.spec.ts @@ -38,12 +38,16 @@ describe('Login-Service', () => { }) ); - it('should trigger a HTTP-GET and receive Users', (() => { + it('should trigger a HTTP-GET and receive User-Object', (() => { + let user = {name: 'admin'}; mockBackend.connections.subscribe(connection => { - const expectedUrl = 'http://localhost:3000/api/users/'; + const expectedUrl = 'http://localhost:3000/api/users?name=admin'; expect(connection.request.url).toBe(expectedUrl); expect(connection.request.method).toBe(RequestMethod.Get); + const response = new ResponseOptions({body: JSON.stringify(user)}); + connection.mockRespond(new Response(response)); }); + loginService.getUser('admin'); })); });