fix(delegates): find active instance

This commit is contained in:
Adam Bradley
2014-11-23 22:42:59 -06:00
parent 72167b2a45
commit 0951b97f06
10 changed files with 98 additions and 22 deletions

View File

@@ -17,7 +17,7 @@ describe('$ionicList controller', function() {
spyOn($ionicListDelegate, '_registerInstance');
var ctrl = setup({delegateHandle: 'foobar'});
expect($ionicListDelegate._registerInstance)
.toHaveBeenCalledWith(ctrl, 'foobar');
.toHaveBeenCalledWith(ctrl, 'foobar', jasmine.any(Function));
}));
it('should register with given handle and deregister on destroy', inject(function($ionicListDelegate) {
@@ -29,7 +29,7 @@ describe('$ionicList controller', function() {
delegateHandle: 'something'
});
expect($ionicListDelegate._registerInstance)
.toHaveBeenCalledWith(ctrl, 'something');
.toHaveBeenCalledWith(ctrl, 'something', jasmine.any(Function));
expect(deregisterSpy).not.toHaveBeenCalled();
ctrl.$scope.$destroy();