diff options
| author | Vojta Jina | 2011-11-01 13:40:51 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-11-30 11:17:24 -0500 |
| commit | 4aaa2f7f6b37f0ad8255e6a320e9136a89e329de (patch) | |
| tree | c29156be96432abcaafee933e01085d1a4b4948f /test/angular-mocksSpec.js | |
| parent | 6290bd4587d9752c3b9eabacd20c90010cc330e3 (diff) | |
| download | angular.js-4aaa2f7f6b37f0ad8255e6a320e9136a89e329de.tar.bz2 | |
feat(mock.$httpBackend): verify expectations after flush()
Diffstat (limited to 'test/angular-mocksSpec.js')
| -rw-r--r-- | test/angular-mocksSpec.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js index 01c1b6ca..6b6f0052 100644 --- a/test/angular-mocksSpec.js +++ b/test/angular-mocksSpec.js @@ -606,6 +606,15 @@ describe('mocks', function() { }); + it('(flush) should throw exception if not all expectations satasfied', function() { + hb.expect('GET', '/url1').respond(); + hb.expect('GET', '/url2').respond(); + + hb('GET', '/url1', null, angular.noop); + expect(function() {hb.flush();}).toThrow('Unsatisfied requests: GET /url2'); + }); + + it('respond() should set default status 200 if not defined', function() { callback.andCallFake(function(status, response) { expect(status).toBe(200); |
