I have a factory which has a method which does a $http call . it takes two obj params and 4 callbacks . How do i unit test the method and it's callbacks using Karma -Jasmine ? all the other answers on stack aren't helping me with callbacks .
app.factory('somefactory', ['$http','$rootScope','dependency',
function($http, $rootScope,dependency){
var factory = {
//two obj params and 4 callback parmas
method:function(obj1,obj2,succCallbk,failureCallbk,errCallbk,completeCallbk){
$http({
method: obj.method,
url: url,
data: requestData
}).success(function(data, status, headers, config){
if(someCondition){
_succCallbk(data, status);
}
if(someCondition){
_completeCallbk(data, status);
}
})
.error(function(err){
if(someCondition){
_errCallbk()}
})
}
};
return factory;
})