title: Jasmine Controller test: $timeout.flush() causes an 'Unexpected GET request' error
body: <p>I have the following test:</p>
  
  <pre><code>it('should load productGroups into the scope', function(){
    scope._section = 'modifiers';
    scope.userData = {method: 'manual'};
    scope.$digest();
    timeout.flush();//causes the error
  
    expect(scope.productGroups).toEqual(productGroupService.getProductGroups());
  });
  </code></pre>
  
  <p>Now, the action that I am trying to test occurs within a timeout of 0, because of some issues I had with syncing the data stored in the cookies.</p>
  
  <p>Now, without the marked line, the test runs find, except the expected result is not obtained.
  With the marked line, I get the following error:</p>
  
  <pre><code>    Error: Unexpected request: GET views/main.html
      No more request expected
          at $httpBackend (/home/oleg/dev/vita-webapp-new/bower_components/angular-mocks/angular-mocks.js:1178:9)
          at sendReq (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:8180:9)
          at $http.serverRequest (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:7921:16)
          at wrappedCallback (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:11319:81)
          at wrappedCallback (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:11319:81)
          at /home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:11405:26
          at Scope.$eval (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12412:28)
          at Scope.$digest (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12224:31)
          at Scope.$apply (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12516:24)
          at Object.fn (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:14023:36)
  
  
  Process finished with exit code 0
  </code></pre>
  
  <p>main.html, is obviously the view of this controller, tried placing it in templateCache with the following code, but it did not help:</p>
  
  <pre><code>$templateCache.put('views/main.html', $templateCache.get('app/views/views/main.html'));
  </code></pre>
  
  <p>Any assistance would be much appreciated.</p>