Testing Ajax Calls
Typically we stub Ajax calls to the server because they’re slow and because they might otherwise require server-side setup to return useful data. We could use plain Jasmine spies for this, or Jasmine’s Ajax framework. Instead I’m going to bring in a different tool that has a slightly higher-level API for managing Ajax.
The tool is called Sinon. It is actually a framework-independent mock-object library, but we’re not going to discuss its generic library, just its fake ...