describe('templates', function () {
  beforeEach(module('prx', 'templates', function ($provide) {
    $provide.decorator('$templateCache', function ($delegate) {
      var put = $delegate.put;
      $delegate.toTest = [];
      $delegate.put = function (uri) {
        this.toTest.push(uri);
        return put.apply(this, [].slice.call(arguments));
      };
      return $delegate;
    });
  }));

  it ('can compile all templates', inject(function ($rootScope, $compile, $templateCache) {
    var scope = $rootScope.$new();
    angular.forEach($templateCache.toTest, function (uri) {
      $compile($templateCache.get(uri))(scope);
    });
  }));
});
@@ -29,16 +29,41 @@
 on () %7B%0A
+  var $scope, $compile;%0A%0A
   before
@@ -112,19 +112,79 @@
 $provide
-) %7B
+, $stateProvider) %7B%0A    $stateProvider.state('fakeState', %7B%7D);%0A
 %0A    $pr
@@ -483,41 +483,19 @@
 %0A%0A  
-it ('can compile all templates', 
+beforeEach(
 inje
@@ -507,16 +507,24 @@
 nction (
+$state, 
 $rootSco
@@ -527,24 +527,25 @@
 tScope, 
+_
 $compile
 , $templ
@@ -540,62 +540,262 @@
 pile
-, $templateCache) %7B%0A    var scope = $rootScope.$new();
+_) %7B%0A    var fakeState = $state.get('fakeState');%0A    fakeState.parent = fakeState;%0A    $state.$current = fakeState;%0A%0A    $scope = $rootScope.$new();%0A    $compile = _$compile_;%0A  %7D));%0A%0A  it ('can compile all templates', inject(function ($templateCache) %7B
 %0A   
@@ -891,16 +891,17 @@
 t(uri))(
+$
 scope);%0A
@@ -915,11 +915,12 @@
 %0A  %7D));%0A
-
 %7D);
+%0A

Set state context in test for template compilability with infinite lineage.