I have a function in my scope to retrieve the status of my service when the user clicks a button, or when some event are triggered and this function is automatically calle
You need to supply the whenGET
before you call the method.
it('Should get the status', function() {
scope.serviceId = '09bb5943fa2881e1';
$httpBackend.whenGET(configuration.entrypoint + configuration.api + '/outbound/service/' + scope.serviceId).respond(200, {"meta":{"apiVersion":"0.1","code":200,"errors":null}});
scope.getStatus();
});
Set up the expectation of the request then trigger the request.
Hope this helps.