@@ -15,17 +15,19 @@ describe('Ng1 StateBuilder', function() {
1515 builder . builder ( 'views' , ng1ViewsBuilder ) ;
1616 } ) ;
1717
18- it ( 'should return a new views object, and copy keys from state def, if no `views` is defined in the state def ' , function ( ) {
18+ it ( 'should use the state object to build a default view, when no `views` property is found ' , function ( ) {
1919 var config = { url : "/foo" , templateUrl : "/foo.html" , controller : "FooController" , parent : parent } ;
2020 var built = builder . builder ( 'views' ) ( config ) ;
2121
2222 expect ( built . $default ) . not . toEqualData ( config ) ;
2323 expect ( built . $default ) . toEqualData ( { templateUrl : "/foo.html" , controller : "FooController" , resolveAs : '$resolve' } ) ;
2424 } ) ;
2525
26- it ( " should return modified view config object if ` views` is defined in the state def" , function ( ) {
26+ it ( 'It should use the views object to build views, when defined, function() {
2727 var config = { a : { foo : "bar" , controller : "FooController" } } ;
28- expect ( builder . builder ( 'views' ) ( { parent : parent , views : config } ) ) . toEqual ( config ) ;
28+ let builtViews = builder . builder ( 'views' ) ( { parent : parent , views : config } ) ;
29+ expect ( builtViews . a . foo ) . toEqualData ( config . a . foo ) ;
30+ expect ( builtViews . a . controller ) . toEqualData ( config . a . controller ) ;
2931 } ) ;
3032
3133 it ( "should not allow a view config with both component and template keys" , inject ( function ( $injector ) {
0 commit comments