title: UI-router interfers with $httpbackend unit test, angular js
body: <p>This is a controller with a submit function:</p>
  
  <pre><code>$scope.submit = function(){   
  
   $http.post('/api/project', $scope.project)
        .success(function(data, status){
          $modalInstance.dismiss(true);
        })
        .error(function(data){
          console.log(data);
        })
    }
  }
  </code></pre>
  
  <p>This is my test</p>
  
  <pre><code>it('should make a post to /api/project on submit and close the modal on success', function() {
      scope.submit();
  
      $httpBackend.expectPOST('/api/project').respond(200, 'test');
  
      $httpBackend.flush();
  
      expect(modalInstance.dismiss).toHaveBeenCalledWith(true);
    });
  </code></pre>
  
  <p>The error I get is: </p>
  
  <pre><code>Error: Unexpected request: GET views/appBar.html
  </code></pre>
  
  <p>views/appBar.html is my templateUrl:</p>
  
  <pre><code> .state('project', {
      url: '/',
      templateUrl:'views/appBar.html',
      controller: 'ProjectsCtrl'
    })
  </code></pre>
  
  <p>So somehow ui-router is making my $httpBackend point to this instead of my submit function. I have the same issue in all my tests using $httpBackend.</p>
  
  <p>Is there any solution to this?</p>