title: $httpBackend.flush(); causes Karma to fail
body: <p>When I run <code>grunt jasmine</code> all my specs pass, but when I run <code>grunt karma</code> Karma basically silently fails since "Warning: Task 'karma:unit' failed. Use --force to continue. Aborted due to warnings." tells me close to nothing. If I remove all of my $httpBackend checks then <code>grunt karma</code> passes again. It almost seems to occur when I add the <code>flush()</code> method.</p>
  
  <p>Both Angular and Angular-Mocks are on 1.2.26.</p>
  
  <p><strong>Does anyone know why my unit tests are failing in Karma and not in Jasmine?</strong></p>
  
  <pre><code>'use strict';
  
  describe('DashboardCtrl spec', function() {
  
    var $scope,
        $route,
        $controller,
        $httpBackend;
  
    // Load the services's module
    beforeEach(module('LocalStorageModule'));
    beforeEach(module('myApp'));
  
    beforeEach(inject(function(_$controller_, $rootScope, _$route_, _$httpBackend_) {
      $scope = $rootScope.$new();
      $route = _$route_;
      $httpBackend = _$httpBackend_;
      $controller = _$controller_;
  
      $httpBackend.expectGET('//localhost:8081/api1/api/things1/').respond({});
      $httpBackend.expectGET('//localhost:8081/api1/api/things2/').respond({
        'next': 'somepage.html'
      });
      $httpBackend.expectGET('views/dashboard.html').respond('&lt;p&gt;&lt;/p&gt;');
      $controller('DashboardCtrl', {$scope: $scope, $route: { current: { params: ''}}});
      $httpBackend.flush();
      $scope.$digest();
    }));
  
    describe('$scope.init()', function() {
  
      it('Check $scope assignments.', function() {
        expect($scope.displayLoadContainer).toBe(true);
      });
  
    });
  
  });
  
  
  
  // Karma configuration
  // http://karma-runner.github.io/0.12/config/configuration-file.html
  // Generated on 2014-09-16 using
  // generator-karma 0.8.3
  
  module.exports = function(config) {
    'use strict';
  
    config.set({
      // enable / disable watching file and executing tests whenever any file changes
      autoWatch: true,
  
      // base path, that will be used to resolve files and exclude
      basePath: '../',
  
      // testing framework to use (jasmine/mocha/qunit/...)
      frameworks: ['jasmine'],
  
      preprocessors: {
        'app/scripts/controllers/dashboard.js': 'coverage'
      },
  
      // list of files / patterns to load in the browser
      files: [
        'bower_components/angular/angular.js',
        'bower_components/angular-mocks/angular-mocks.js',
        'bower_components/angular-animate/angular-animate.js',
        'bower_components/angular-cookies/angular-cookies.js',
        'bower_components/angular-resource/angular-resource.js',
        'bower_components/angular-route/angular-route.js',
        'bower_components/angular-sanitize/angular-sanitize.js',
        'bower_components/angular-touch/angular-touch.js',
        'bower_components/tp-utils/app/scripts/services/tp-utils.js',
        'bower_components/angular-local-storage/angular-local-storage.js',
        'bower_components/ngInfiniteScroll/build/ng-infinite-scroll.js',
        'bower_components/tp-services/dist/tp-services.js',
  
        'app/scripts/app.js',
        'app/scripts/api-dev.js',
        'app/scripts/controllers/dashboard.js',
  
        'test/spec/**/*.js'
      ],
  
      // list of files / patterns to exclude
      exclude: [],
  
      // web server port
      port: 8080,
  
      // Start these browsers, currently available:
      // - Chrome
      // - ChromeCanary
      // - Firefox
      // - Opera
      // - Safari (only Mac)
      // - PhantomJS
      // - IE (only Windows)
      browsers: [
        'PhantomJS'
      ],
  
      // Which plugins to enable
      plugins: [
        'karma-phantomjs-launcher',
        'karma-jasmine',
        'karma-coverage'
      ],
  
      reporters: ['coverage'],
      coverageReporter: {
        type : 'text',
        dir : 'coverage/'
      },
  
      // Continuous Integration mode
      // if true, it capture browsers, run tests and exit
      singleRun: false,
  
      colors: true,
  
      // level of logging
      // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
      logLevel: config.LOG_INFO,
  
      // Uncomment the following lines if you are using grunt's server to run the tests
      // proxies: {
      //   '/': 'http://localhost:9000/'
      // },
      // URL root prevent conflicts with the site root
      // urlRoot: '_karma_'
    });
  };
  </code></pre>