diff options
Diffstat (limited to 'test/directivesSpec.js')
| -rw-r--r-- | test/directivesSpec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 06a3a2dd..0a7e3c18 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -156,4 +156,19 @@ describe("directives", function(){ scope.$eval(); expect(element.css('display')).toEqual(''); }); + + it('should ng-controller', function(){ + window.Greeter = function(){ + this.greeting = 'hello'; + }; + window.Greeter.prototype = { + greet: function(name) { + return this.greeting + ' ' + name; + } + }; + var scope = compile('<div ng-controller="Greeter"></div>'); + expect(scope.greeting).toEqual('hello'); + expect(scope.greet('misko')).toEqual('hello misko'); + delete window.Greeter; + }); }); |
