Today I create a test class for ajax calls from Angular controller.
I already setup the mock HTTP response but when I run the test still say Unexpected request
After a while trying I found out that when you use the “expectGET” mock HTTP response must be the same order as when your controller request.
You can open Developer mode in your browser, Network tab, see the order of the XHR request were made then change your mock HTTP response to be the same order. It is working fine now.
comments powered by Disqus