I'm answering this question by self.

The angular mocks provide the mocked $httpBackend when you are using 
Jasmine tests, but the actual $httpBackend still exists. You just need to 
tell the provider to use the original when you inject the service. It will 
look something like this in your test:

I found it 
here 
http://stackoverflow.com/questions/16342473/angular-jasmine-can-real-xhr-be-executed

On Sunday, August 23, 2015 at 11:30:57 AM UTC+5:30, Sagar Rayudu wrote:
>
> Do angular sends real xhr to server when we test the methods in services 
> that depend on $http and $resource ?
> I found that it is not producing any xhrs when the service method is 
> called from Jasmine. 
> Why it is happening ? I need some clear understanding of what is happening 
> there ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to