mercredi 22 juin 2016

Angular Unit Test | service | $httpbackend always execute error branch when responded with 401 or 500 status code

I'm using the $httpbackend.

when we mock the particular service,we then respond it with status code like 200-209 which triggers success branch and other triggers error branch.
My service can send a response with different status code, and i have to redirect the user to error pages.
if i respond with 401, or 500 status code, error branch is getting executed. how can i get these status code in success branch

http://ift.tt/28Rs4DI

Aucun commentaire:

Enregistrer un commentaire