title: Testing directives with template URL
body: <p>I'm trying to test an angularJS directive that uses a templateURL.  For the life of me I can't get the compiler to actually load the templateURL, even when it has been put into the templateCache. I realize karma preprocesses all the template contents and creates modules for each that preloads the templateCache, but I expected that this would have been equivalent.  </p>
  
  <p>Here is a <a href="http://jsfiddle.net/devshorts/cxN22/2/" rel="nofollow">http://jsfiddle.net/devshorts/cxN22/2/</a> that demonstrates whats going on.  </p>
  
  <pre><code>angular.module("app", [])
  .directive("test", function(){
      return {
          templateUrl:"some.html",
          replace:true
      }
  });
  
  //--- SPECS -------------------------
  
  describe("template url test", function() {
      var element,  scope, manualCompiledElement;
  
      beforeEach(module('app'));
  
      beforeEach(inject(function($rootScope, $controller, $compile, $templateCache){
          $templateCache.put("some.html", "&lt;div&gt;hello&lt;/div&gt;");
  
          scope = $rootScope.$new();
  
          element = $compile(angular.element('&lt;test&gt;&lt;/test&gt;'))(scope);
  
          manualCompiledElement = $compile(angular.element($templateCache.get('some.html')))(scope);
  
          scope.$digest();        
      }));
  
      it("has hello", function() {
          expect(element.text()).toContain('hello');
      });
  
      it("template cache has contents", function(){
          expect(manualCompiledElement.text()).toContain('hello');
      });       
  });
  </code></pre>
  
  <p>What am I missing?</p>