Javascript 没有待处理的刷新请求

Javascript 没有待处理的刷新请求,javascript,angularjs,karma-jasmine,Javascript,Angularjs,Karma Jasmine,在我的测试中,我遇到了以下错误: Error: No pending request to flush ! at Function.$httpBackend.flush (/home/arpho/Projects/neo4Scrum/app/bower_components/angular-mocks/angular-mocks.js:1482:34) at null.<anonymous> (/home/arpho/Projects/neo4Scrum/test/spec/cont

在我的测试中,我遇到了以下错误:

Error: No pending request to flush !
at Function.$httpBackend.flush (/home/arpho/Projects/neo4Scrum/app/bower_components/angular-mocks/angular-mocks.js:1482:34)
at null.<anonymous> (/home/arpho/Projects/neo4Scrum/test/spec/controllers/customer.js:95:18)
我看到其他人也有同样的问题,但我无法解决 我的主控键:

'use strict';

angular.module('neo4ScrumApp').controller('MainCtrl', function ($scope, $http) {
  http.get('/api/awesomeThings').success(function(aw){$scope.awesomeThings = aw;})
});
我的客户Ctrl:

'use strict';
angular.module('neo4ScrumApp').controller('CustomerCtrl',['$scope','$http','$routeParams', function($scope,$http,$routeParams) {
    var customerId = $routeParams.customerId; // rimuovo :
    if (typeof customerId != 'undefined') {
        console.log("cerco customer "+customerId);
        $http.get('/api/customer/:'+customerId).success(function(customer) {
            $scope.customer = customer.data[0].data;
            $scope.customer.id = customer.id;
            $scope.action = 'update';
        })
    }
    else 
        $scope.action = 'save';
}])

GET请求是否已发送?如果是,由谁,在哪里?谢谢,但为什么是这个:正在从事不同的项目?因为这是一个不同的项目;)我认为第二个不同项目中的控制器在启动时(实例化时)会发送GET请求,但这一个不会。请编辑你的问题并复制你的控制器代码(这一个)好吗
'use strict';
angular.module('neo4ScrumApp').controller('CustomerCtrl',['$scope','$http','$routeParams', function($scope,$http,$routeParams) {
    var customerId = $routeParams.customerId; // rimuovo :
    if (typeof customerId != 'undefined') {
        console.log("cerco customer "+customerId);
        $http.get('/api/customer/:'+customerId).success(function(customer) {
            $scope.customer = customer.data[0].data;
            $scope.customer.id = customer.id;
            $scope.action = 'update';
        })
    }
    else 
        $scope.action = 'save';
}])