In Angular-Controller, ich habe einige Codes wie:wie man response.headers ('location') in Jasmin mockt?
$http.save('api/purchases').$promise.then(function(response) {
var location = response.headers('location'); // to retrieve the location in response header
})
in Unit-Test von Jasmin,
it('..', function(){
$httpBackend.expectPost('api/purchase').respond(201, {}, {location: 'xxx'});
// when run the test, it reports an error with 'undefined is not a constructor' (evaluting response.headers('location'))
})
Wie kann ich die response.headers testen ('location')?
Danke, aber es ist nicht der Grund – junlin