aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVojta Jina2012-03-08 15:03:24 -0800
committerVojta Jina2012-03-09 10:10:28 -0800
commite0c9551fd7c716d9d71ed6f4f1d2f5911f53032c (patch)
treef98632d66538460b1405d217342f483de6d519df /test
parentfae84463e45f18eabdabc4c1c7378e23ad35842c (diff)
downloadangular.js-e0c9551fd7c716d9d71ed6f4f1d2f5911f53032c.tar.bz2
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);
Diffstat (limited to 'test')
-rw-r--r--test/directive/inputSpec.js6
1 files changed, 5 insertions, 1 deletions
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');
});