This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -58,25 +58,17 @@ describe('$controller', function() {
58
58
} ) ;
59
59
60
60
it ( 'should return true when having an existing controller' , function ( ) {
61
- var FooCtrl = function ( $scope ) { $scope . foo = 'foo' ; } ,
62
- scope = { } ,
63
- ctrl ;
61
+ var FooCtrl = function ( $scope ) { $scope . foo = 'foo' ; } ;
64
62
65
63
$controllerProvider . register ( { FooCtrl : FooCtrl } ) ;
66
-
67
- ctrl = $controller ( 'FooCtrl' , { $scope : scope } ) ;
68
- expect ( ctrl . has ( 'FooCtrl' ) ) . toBe ( true ) ;
64
+ expect ( $controllerProvider . has ( 'FooCtrl' ) ) . toBe ( true ) ;
69
65
} ) ;
70
66
71
67
it ( 'should return false when not having a non existing controller' , function ( ) {
72
- var FooCtrl = function ( $scope ) { $scope . foo = 'foo' ; } ,
73
- scope = { } ,
74
- ctrl ;
68
+ var FooCtrl = function ( $scope ) { $scope . foo = 'foo' ; } ;
75
69
76
70
$controllerProvider . register ( { FooCtrl : FooCtrl } ) ;
77
-
78
- ctrl = $controller ( 'FooCtrl' , { $scope : scope } ) ;
79
- expect ( ctrl . has ( 'whatever' ) ) . toBe ( false ) ;
71
+ expect ( $controllerProvider . has ( 'BarCtrl' ) ) . toBe ( false ) ;
80
72
} ) ;
81
73
82
74
it ( 'should allow registration of controllers annotated with arrays' , function ( ) {
You can’t perform that action at this time.
0 commit comments