title: AngularJS / Karma unit testing with real XHR data / passThrough()
body: <p>I would like to use real $http data for my unit test using passThrough().</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>var should = chai.should();
  beforeEach(module('myApp', 'ngMockE2E'));
  beforeEach(inject(function(_$httpBackend_, _$rootScope_, _$http_) {
    $scope = _$rootScope_;
    $http = _$http_;
    $httpBackend = _$httpBackend_;
  }));
  
  it.only('blah', function(done) {
   $httpBackend.whenGET('/api/data').passThrough();
  
    $scope.$apply(function() {
    $http.get('/api/data').success(function(data) {
     data.should.eql({"foo": "bar"});
      done();
    });
  });
  
  // Evidently not required with E2E
  //$httpBackend.flush();
  
  });
  </code></pre>
  
  <p>But this gives an error:</p>
  
  <pre><code>Unexpected request: GET /api/data
  No more request expected
  Error: Unexpected request: GET /api/data
  No more request expected
  </code></pre>
  
  <p>If I remove the apply call it times out.</p>