diff options
| author | Vojta Jina | 2013-04-30 11:48:59 -0700 | 
|---|---|---|
| committer | Vojta Jina | 2013-04-30 14:38:14 -0700 | 
| commit | e295eeefaa26b203cefb8b1148417e4c4f85e037 (patch) | |
| tree | 5eac74600e3f5144a47d7c16f2ccf7c972a53303 /test/ng/controllerSpec.js | |
| parent | de2cdb0658b8b8cff5a59e26c5ec1c9b470efb9b (diff) | |
| download | angular.js-e295eeefaa26b203cefb8b1148417e4c4f85e037.tar.bz2 | |
test(controller): instantiate controller defined on window
Just adding a missing spec.
Diffstat (limited to 'test/ng/controllerSpec.js')
| -rw-r--r-- | test/ng/controllerSpec.js | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/test/ng/controllerSpec.js b/test/ng/controllerSpec.js index 48691309..f0dcb407 100644 --- a/test/ng/controllerSpec.js +++ b/test/ng/controllerSpec.js @@ -90,6 +90,18 @@ describe('$controller', function() {    }); +  it('should instantiate controller defined on window', inject(function($window) { +    var scope = {}; +    var Foo = function() {}; + +    $window.a = {Foo: Foo}; + +    var foo = $controller('a.Foo', {$scope: scope}); +    expect(foo).toBeDefined(); +    expect(foo instanceof Foo).toBe(true); +  })); + +    describe('ctrl as syntax', function() {      it('should publish controller instance into scope', function() { | 
