From afbe073121f13a23dc33a1d958c0a964029dc6ee Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Mon, 31 Oct 2011 20:34:03 -0700 Subject: feat(mock.$httpBackend): add verifyNoOutstandingRequest method + rename verifyExpectations to verifyNoOutstandingExpectation --- src/angular-mocks.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/angular-mocks.js b/src/angular-mocks.js index e2348f6b..4cf4236c 100644 --- a/src/angular-mocks.js +++ b/src/angular-mocks.js @@ -664,12 +664,18 @@ angular.module.ngMock.$HttpBackendProvider = function() { } }; - $httpBackend.verifyExpectations = function() { + $httpBackend.verifyNoOutstandingExpectation = function() { if (expectations.length) { throw Error('Unsatisfied requests: ' + expectations.join(', ')); } }; + $httpBackend.verifyNoOutstandingRequest = function() { + if (responses.length) { + throw Error('Unflushed requests: ' + responses.length); + } + }; + $httpBackend.resetExpectations = function() { expectations = []; responses = []; -- cgit v1.2.3