From e0c9551fd7c716d9d71ed6f4f1d2f5911f53032c Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 8 Mar 2012 15:03:24 -0800 Subject: refactor(forms): remove registerWidget and use event instead Each widget (ng-model directive) emits $newFormControl event instead of getting hold of parent form and calling form.registerWidget(this); --- test/directive/inputSpec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/directive/inputSpec.js') diff --git a/test/directive/inputSpec.js b/test/directive/inputSpec.js index d9f6b7b3..54f3f7cd 100644 --- a/test/directive/inputSpec.js +++ b/test/directive/inputSpec.js @@ -4,9 +4,11 @@ describe('NgModelController', function() { var ctrl, scope, ngModelAccessor; beforeEach(inject(function($rootScope, $controller) { + var attrs = {name: 'testAlias'}; + scope = $rootScope; ngModelAccessor = jasmine.createSpy('ngModel accessor'); - ctrl = $controller(NgModelController, {$scope: scope, ngModel: ngModelAccessor}); + ctrl = $controller(NgModelController, {$scope: scope, ngModel: ngModelAccessor, $attrs: attrs}); // mock accessor (locals) ngModelAccessor.andCallFake(function(val) { @@ -27,6 +29,8 @@ describe('NgModelController', function() { expect(ctrl.formatters).toEqual([]); expect(ctrl.parsers).toEqual([]); + + expect(ctrl.widgetId).toBe('testAlias'); }); -- cgit v1.2.3