Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
test(controller): instantiate controller defined on window
Browse files Browse the repository at this point in the history
Just adding a missing spec.
  • Loading branch information
vojtajina committed Apr 30, 2013
1 parent de2cdb0 commit e295eee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ng/controllerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e295eee

Please sign in to comment.