AngularJs Jasmine测试中$ httBackend中的不满意请求

时间:2015-12-18 09:25:39

标签: javascript angularjs karma-jasmine

    // Devices call
    httpBackend.expect('GET', '/v1/devices/machine/22')
        .respond(200,mock_Device);

    //DevicesConfig call
    httpBackend.expect('GET', '/v2/devices/config/19442')
        .respond(200,mock_Devices_Config);

    //LatestDevices call
    httpBackend.expect('GET', '/v1/devices/latest/19442')
        .respond(200,mock_Devices_Latest);

    //Machinehistory call
    httpBackend.expect('GET', '/v1/devices/history/19442/5')
        .respond(200,mock_Machine_History);

it('It should fetch all machines details', function() {
    httpBackend.flush();
    scope.getMachines(); --Controller Call

}

在控制器中,我将打电话给承诺的服务。除了正在获取的机器历史调用之外,所有的调用都被传递

错误:不满意的请求:

请帮我解决这个错误。

0 个答案:

没有答案