I have a function like this
$scope.openMail=function(mail){
DocumentTypes.getDocument(function(response){
$scope.documentTypes=response.result;
$log.log("documentTypes",$scope.documentTypes);
})
}
Spec for above fun is
it("should test open mail", function(){
scope.documentTypes=[{"type":"pdf"},{"type":"xml"}];
spyOn(documentTypes,"getDocument").and.callFake(function(){
return scope.documentTypes;
});
var mail='back';
scope.openMail(mail);
expect(scope.documentTypes).toEqual({"type":"pdf"},{"type":"xml"});
})
so the code is not covering for function(response){}
