Although Jasmine already has support for Stubs and Spies, we are going to use a specific functionality of Sinon.JS to test AJAX requests, its
The main difference between a Stub and a Fake, as you will see with the
FakeXMLHttpRequest object, is that a Fake is like a simpler but still complete implementation of a real component, and it is usually set at a system level.
Before we dig into the spec implementation, first we need to add Sinon.JS to the project. Go to http://sinonjs.org/ and download the current ...