How to test an Angular controller with a function that makes an AJAX call without mocking the AJAX call?
问题 I have a function in a controller that calls a service which in turn calls another service, which makes the AJAX call and returns the promise. To put it simply: MainController call = function(){ //Handle the promise here, update some configs and stuff someService.call().then(success, failure); } SomeService return { call: function(){ return SomeOtherService.call(); } } SomeOtherService return { call: function(){ return $http.get(someUrl); } } How do I test the main controller's call function