diff options
Diffstat (limited to 'test/ng/controllerSpec.js')
| -rw-r--r-- | test/ng/controllerSpec.js | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/test/ng/controllerSpec.js b/test/ng/controllerSpec.js index f0dcb407..b041dec7 100644 --- a/test/ng/controllerSpec.js +++ b/test/ng/controllerSpec.js @@ -124,5 +124,15 @@ describe('$controller', function() {        expect(scope.foo).toBe(foo);        expect(scope.foo.mark).toBe('foo');      }); + + +    it('should throw an error if $scope is not provided', function() { +      $controllerProvider.register('a.b.FooCtrl', function() { this.mark = 'foo'; }); + +      expect(function() { +        $controller('a.b.FooCtrl as foo'); +      }).toThrow("[NgErr47] Cannot export controller 'a.b.FooCtrl' as 'foo'! No $scope object provided via `locals`."); + +    });    });  }); | 
