aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVojta Jina2013-04-30 11:47:23 -0700
committerVojta Jina2013-04-30 14:38:14 -0700
commitde2cdb0658b8b8cff5a59e26c5ec1c9b470efb9b (patch)
treee782f1f53abe9d0780c3863641eb4ef4521a6c0e /test
parentcda7b71146f6748116ad5bbc9050ee7e79a9ce2b (diff)
downloadangular.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.js26
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');
+ });
});
});