aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/controllerSpec.js
diff options
context:
space:
mode:
authorVojta Jina2013-04-30 11:48:59 -0700
committerVojta Jina2013-04-30 14:38:14 -0700
commite295eeefaa26b203cefb8b1148417e4c4f85e037 (patch)
tree5eac74600e3f5144a47d7c16f2ccf7c972a53303 /test/ng/controllerSpec.js
parentde2cdb0658b8b8cff5a59e26c5ec1c9b470efb9b (diff)
downloadangular.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.js12
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() {