diff options
Diffstat (limited to 'test')
| -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() { |
