it('should login and save the user', fakeAsync(() => {
const fakeCredentials = { username: 'foo', password: 'bar' };
const fakeResponse = { username: 'foo', token: 'tokenbytes' };
- service.login(<any>fakeCredentials);
+ service.login(fakeCredentials).subscribe();
const req = httpTesting.expectOne('api/auth');
expect(req.request.method).toBe('POST');
expect(req.request.body).toEqual(fakeCredentials);