aboutsummaryrefslogtreecommitdiffstats
path: root/test/angular-mocksSpec.js
diff options
context:
space:
mode:
authorVojta Jina2012-01-10 23:08:30 -0800
committerVojta Jina2012-01-11 11:48:03 -0800
commitc6ea1be0536b9d4564f028554fd1762feba58994 (patch)
treecd17e535796b45dfebda799b317eae0d0812e3d6 /test/angular-mocksSpec.js
parent5143e7bf065a3cbdf8400cf095b653d51bc83b8f (diff)
downloadangular.js-c6ea1be0536b9d4564f028554fd1762feba58994.tar.bz2
fix(mock.$httpBackend): resetExpectations should not create new array
Diffstat (limited to 'test/angular-mocksSpec.js')
-rw-r--r--test/angular-mocksSpec.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js
index d7f40bb2..248bb108 100644
--- a/test/angular-mocksSpec.js
+++ b/test/angular-mocksSpec.js
@@ -780,6 +780,21 @@ describe('mocks', function() {
expect(callback).toHaveBeenCalledOnce();
expect(cancelledClb).not.toHaveBeenCalled();
});
+
+
+ it('should not remove definitions', function() {
+ var cancelledClb = jasmine.createSpy('cancelled');
+
+ hb.when('GET', '/url').respond(200, 'success');
+ hb('GET', '/url', null, cancelledClb);
+ hb.resetExpectations();
+
+ hb('GET', '/url', null, callback, {});
+ hb.flush();
+
+ expect(callback).toHaveBeenCalledOnce();
+ expect(cancelledClb).not.toHaveBeenCalled();
+ });
});