From 2430f52bb97fa9d682e5f028c977c5bf94c5ec38 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 23 Mar 2012 14:03:24 -0700 Subject: chore(module): move files around in preparation for more modules --- test/directive/ngControllerSpec.js | 65 -------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 test/directive/ngControllerSpec.js (limited to 'test/directive/ngControllerSpec.js') diff --git a/test/directive/ngControllerSpec.js b/test/directive/ngControllerSpec.js deleted file mode 100644 index 832a683d..00000000 --- a/test/directive/ngControllerSpec.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -describe('ng-controller', function() { - var element; - - beforeEach(inject(function($window) { - $window.Greeter = function($scope) { - // private stuff (not exported to scope) - this.prefix = 'Hello '; - - // public stuff (exported to scope) - var ctrl = this; - $scope.name = 'Misko'; - $scope.greet = function(name) { - return ctrl.prefix + name + ctrl.suffix; - }; - - $scope.protoGreet = bind(this, this.protoGreet); - }; - $window.Greeter.prototype = { - suffix: '!', - protoGreet: function(name) { - return this.prefix + name + this.suffix; - } - }; - - $window.Child = function($scope) { - $scope.name = 'Adam'; - }; - })); - - afterEach(function() { - dealoc(element); - }); - - - it('should instantiate controller and bind methods', inject(function($compile, $rootScope) { - element = $compile('
{{greet(name)}}
')($rootScope); - $rootScope.$digest(); - expect(element.text()).toBe('Hello Misko!'); - })); - - - it('should allow nested controllers', inject(function($compile, $rootScope) { - element = $compile('
{{greet(name)}}
')($rootScope); - $rootScope.$digest(); - expect(element.text()).toBe('Hello Adam!'); - dealoc(element); - - element = $compile('
{{protoGreet(name)}}
')($rootScope); - $rootScope.$digest(); - expect(element.text()).toBe('Hello Adam!'); - })); - - - it('should instantiate controller defined on scope', inject(function($compile, $rootScope) { - $rootScope.Greeter = function($scope) { - $scope.name = 'Vojta'; - }; - - element = $compile('
{{name}}
')($rootScope); - $rootScope.$digest(); - expect(element.text()).toBe('Vojta'); - })); -}); -- cgit v1.2.3