From e295eeefaa26b203cefb8b1148417e4c4f85e037 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 30 Apr 2013 11:48:59 -0700 Subject: test(controller): instantiate controller defined on window Just adding a missing spec. --- test/ng/controllerSpec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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() { -- cgit v1.2.3