diff options
| author | Igor Minar | 2011-10-26 11:38:04 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-10-26 12:02:30 -0700 |
| commit | bb948176aaf6748c0d27772797b4c1490612b917 (patch) | |
| tree | cd2f734ea81ad8e74ef8df12693a179150216d73 /test/widgetsSpec.js | |
| parent | 163c799effd5cfadc57990f4d4127651bae3fbdb (diff) | |
| download | angular.js-bb948176aaf6748c0d27772797b4c1490612b917.tar.bz2 | |
test(ng:view): spec cleanup
- remove optional controller definition from specs
- remove extranious digest calls
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 90555325..adbdf94e 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -429,56 +429,50 @@ describe("widget", function() { it('should load content via xhr when route changes', function() { - $route.when('/foo', {controller: angular.noop, template: 'myUrl1'}); - $route.when('/bar', {controller: angular.noop, template: 'myUrl2'}); + $route.when('/foo', {template: 'myUrl1'}); + $route.when('/bar', {template: 'myUrl2'}); expect(rootScope.$element.text()).toEqual(''); $location.path('/foo'); $browser.xhr.expectGET('myUrl1').respond('<div>{{1+3}}</div>'); rootScope.$digest(); - rootScope.$digest(); $browser.xhr.flush(); expect(rootScope.$element.text()).toEqual('4'); $location.path('/bar'); $browser.xhr.expectGET('myUrl2').respond('angular is da best'); rootScope.$digest(); - rootScope.$digest(); $browser.xhr.flush(); expect(rootScope.$element.text()).toEqual('angular is da best'); }); it('should remove all content when location changes to an unknown route', function() { - $route.when('/foo', {controller: angular.noop, template: 'myUrl1'}); + $route.when('/foo', {template: 'myUrl1'}); $location.path('/foo'); $browser.xhr.expectGET('myUrl1').respond('<div>{{1+3}}</div>'); rootScope.$digest(); - rootScope.$digest(); $browser.xhr.flush(); expect(rootScope.$element.text()).toEqual('4'); $location.path('/unknown'); rootScope.$digest(); - rootScope.$digest(); expect(rootScope.$element.text()).toEqual(''); }); it('should chain scopes and propagate evals to the child scope', function() { - $route.when('/foo', {controller: angular.noop, template: 'myUrl1'}); + $route.when('/foo', {template: 'myUrl1'}); rootScope.parentVar = 'parent'; $location.path('/foo'); $browser.xhr.expectGET('myUrl1').respond('<div>{{parentVar}}</div>'); rootScope.$digest(); - rootScope.$digest(); $browser.xhr.flush(); expect(rootScope.$element.text()).toEqual('parent'); rootScope.parentVar = 'new parent'; rootScope.$digest(); - rootScope.$digest(); expect(rootScope.$element.text()).toEqual('new parent'); }); @@ -510,7 +504,7 @@ describe("widget", function() { it('should initialize view template after the view controller was initialized even when ' + 'templates were cached', function() { - //this is a test for a regression that was introduced by making the ng:view cache sync + // this is a test for a regression that was introduced by making the ng:view cache sync $route.when('/foo', {controller: ParentCtrl, template: 'viewPartial.html'}); |
