You can verify that calls are not being made using the verifyNoOutstandingRequest() method from $ httpBackend mock .
Typically, this check is performed in the afterEach section of afterEach tests. In addition, to call another method, verifyNoOutstandingExpectation() , you must verify that all expected calls have actually been called.
Here is the code where you need to enter $httpBackend mock:
var $httpBackend; beforeEach(inject(function($injector) { $httpBackend = $injector.get('$httpBackend'); }));
then you test and at the end:
afterEach(function() { $httpBackend.verifyNoOutstandingExpectation(); $httpBackend.verifyNoOutstandingRequest(); });
Of course, you can call $httpBackend.verifyNoOutstandingRequest() inside a separate test. The mentioned page http://docs.angularjs.org/api/ngMock.$httpBackend contains a lot of information on this topic.
source share