title: test login with karma failed, got error of unexpected request
body: <p>I got error of using karma testing my auth endpoint</p>
  
  <pre><code>Error: Unexpected request: GET partials/dashboard.html
      No more request expected
  </code></pre>
  
  <p>My spec.js</p>
  
  <pre><code>describe('LogController', function() {
    var $scope, controller, $location, $window;
  
    beforeEach(module('MyApp'));
  
    beforeEach(inject(function($rootScope, $controller, _$location_, _$window_, _$httpBackend_) {
      $scope = $rootScope.$new();
      $window = _$window_;
      $httpBackend = _$httpBackend_;
      $location = _$location_;
      controller = $controller('loginCtrl', {
        $scope: $scope,
        $location: $location,
        $window: $window
      });
    }))
  
     it('should log in a user and redirect to homepage', function() {
  
       $httpBackend.whenPOST('/user/login').respond(200);
       $scope.username = 'test';
       $scope.password = '123456';
       $scope.login();
  
       $httpBackend.flush();
       $scope.$digest();
       expect($location.path()).toBe('/x'); 
     });
  
  })
  </code></pre>
  
  <p>I thought I already flush()? why it call my partial/dashboard.html? I'm lost.</p>