diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 816aa4a7b503..6b425cca4c1e 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -3720,6 +3720,25 @@ describe('$compile', function() { }); + it('should get required parent controller when the question mark precedes the ^^', function() { + module(function() { + directive('nested', function(log) { + return { + require: '?^^nested', + controller: function($scope) {}, + link: function(scope, element, attrs, controller) { + log(!!controller); + } + }; + }); + }); + inject(function(log, $compile, $rootScope) { + element = $compile('
')($rootScope); + expect(log).toEqual('true; false'); + }); + }); + + it('should throw if required parent is not found', function() { module(function() { directive('nested', function() {