Also, I had been using mockjax to mock out my ajax calls, but it wasn't doing it for me. First, I found it painful to specify the expected posted data (something critically important). I also wanted the stub to work synchronously to greatly increase the readability of my test. A coworker and I had a disagreement about whether this was good. His belief was that making a synchronous stub out of an asynchronous call is diverging too far away from the actual code. My belief is that the unreliable nature of asynchronous code means that it should be interchange with synchronous code - if you have code that relies on being execute either before or after a async call, that must be explicitly coded for.
Check out the source code on github at: http://github.com/karlseguin/jstub and let me know what you think.