diff options
| author | Vojta Jina | 2013-04-30 11:47:23 -0700 | 
|---|---|---|
| committer | Vojta Jina | 2013-04-30 14:38:14 -0700 | 
| commit | de2cdb0658b8b8cff5a59e26c5ec1c9b470efb9b (patch) | |
| tree | e782f1f53abe9d0780c3863641eb4ef4521a6c0e /test | |
| parent | cda7b71146f6748116ad5bbc9050ee7e79a9ce2b (diff) | |
| download | angular.js-de2cdb0658b8b8cff5a59e26c5ec1c9b470efb9b.tar.bz2 | |
fix(ngController): allow dots in a controller name
The issue was introduced in cd38cbf975b501d846e6149d1d993972a1af0053
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/controllerSpec.js | 26 | 
1 files changed, 20 insertions, 6 deletions
| diff --git a/test/ng/controllerSpec.js b/test/ng/controllerSpec.js index e34463b0..48691309 100644 --- a/test/ng/controllerSpec.js +++ b/test/ng/controllerSpec.js @@ -90,13 +90,27 @@ describe('$controller', function() {    }); -  it('should publish controller instance into scope', function() { -    var scope = {}; +  describe('ctrl as syntax', function() { -    $controllerProvider.register('FooCtrl', function() { this.mark = 'foo'; }); +    it('should publish controller instance into scope', function() { +      var scope = {}; -    var foo = $controller('FooCtrl as foo', {$scope: scope}); -    expect(scope.foo).toBe(foo); -    expect(scope.foo.mark).toBe('foo'); +      $controllerProvider.register('FooCtrl', function() { this.mark = 'foo'; }); + +      var foo = $controller('FooCtrl as foo', {$scope: scope}); +      expect(scope.foo).toBe(foo); +      expect(scope.foo.mark).toBe('foo'); +    }); + + +    it('should allow controllers with dots', function() { +      var scope = {}; + +      $controllerProvider.register('a.b.FooCtrl', function() { this.mark = 'foo'; }); + +      var foo = $controller('a.b.FooCtrl as foo', {$scope: scope}); +      expect(scope.foo).toBe(foo); +      expect(scope.foo.mark).toBe('foo'); +    });    });  }); | 
