@@ -429,56 +429,50 @@ describe("widget", function() {
429
429
430
430
431
431
it ( 'should load content via xhr when route changes' , function ( ) {
432
- $route . when ( '/foo' , { controller : angular . noop , template : 'myUrl1' } ) ;
433
- $route . when ( '/bar' , { controller : angular . noop , template : 'myUrl2' } ) ;
432
+ $route . when ( '/foo' , { template : 'myUrl1' } ) ;
433
+ $route . when ( '/bar' , { template : 'myUrl2' } ) ;
434
434
435
435
expect ( rootScope . $element . text ( ) ) . toEqual ( '' ) ;
436
436
437
437
$location . path ( '/foo' ) ;
438
438
$browser . xhr . expectGET ( 'myUrl1' ) . respond ( '<div>{{1+3}}</div>' ) ;
439
439
rootScope . $digest ( ) ;
440
- rootScope . $digest ( ) ;
441
440
$browser . xhr . flush ( ) ;
442
441
expect ( rootScope . $element . text ( ) ) . toEqual ( '4' ) ;
443
442
444
443
$location . path ( '/bar' ) ;
445
444
$browser . xhr . expectGET ( 'myUrl2' ) . respond ( 'angular is da best' ) ;
446
445
rootScope . $digest ( ) ;
447
- rootScope . $digest ( ) ;
448
446
$browser . xhr . flush ( ) ;
449
447
expect ( rootScope . $element . text ( ) ) . toEqual ( 'angular is da best' ) ;
450
448
} ) ;
451
449
452
450
it ( 'should remove all content when location changes to an unknown route' , function ( ) {
453
- $route . when ( '/foo' , { controller : angular . noop , template : 'myUrl1' } ) ;
451
+ $route . when ( '/foo' , { template : 'myUrl1' } ) ;
454
452
455
453
$location . path ( '/foo' ) ;
456
454
$browser . xhr . expectGET ( 'myUrl1' ) . respond ( '<div>{{1+3}}</div>' ) ;
457
455
rootScope . $digest ( ) ;
458
- rootScope . $digest ( ) ;
459
456
$browser . xhr . flush ( ) ;
460
457
expect ( rootScope . $element . text ( ) ) . toEqual ( '4' ) ;
461
458
462
459
$location . path ( '/unknown' ) ;
463
460
rootScope . $digest ( ) ;
464
- rootScope . $digest ( ) ;
465
461
expect ( rootScope . $element . text ( ) ) . toEqual ( '' ) ;
466
462
} ) ;
467
463
468
464
it ( 'should chain scopes and propagate evals to the child scope' , function ( ) {
469
- $route . when ( '/foo' , { controller : angular . noop , template : 'myUrl1' } ) ;
465
+ $route . when ( '/foo' , { template : 'myUrl1' } ) ;
470
466
rootScope . parentVar = 'parent' ;
471
467
472
468
$location . path ( '/foo' ) ;
473
469
$browser . xhr . expectGET ( 'myUrl1' ) . respond ( '<div>{{parentVar}}</div>' ) ;
474
470
rootScope . $digest ( ) ;
475
- rootScope . $digest ( ) ;
476
471
$browser . xhr . flush ( ) ;
477
472
expect ( rootScope . $element . text ( ) ) . toEqual ( 'parent' ) ;
478
473
479
474
rootScope . parentVar = 'new parent' ;
480
475
rootScope . $digest ( ) ;
481
- rootScope . $digest ( ) ;
482
476
expect ( rootScope . $element . text ( ) ) . toEqual ( 'new parent' ) ;
483
477
} ) ;
484
478
@@ -510,7 +504,7 @@ describe("widget", function() {
510
504
511
505
it ( 'should initialize view template after the view controller was initialized even when ' +
512
506
'templates were cached' , function ( ) {
513
- //this is a test for a regression that was introduced by making the ng:view cache sync
507
+ // this is a test for a regression that was introduced by making the ng:view cache sync
514
508
515
509
$route . when ( '/foo' , { controller : ParentCtrl , template : 'viewPartial.html' } ) ;
516
510
0 commit comments