mileskin/jasmine-fake-ajax — Issue #7: Overriden fake ajax should return a jQuery Deferred object
Author: craigspaeth
Created: 2011-12-12 21:22:07+00:00
State: open

I need to assert something after a fail handler that depends on $.ajax returning a jQuery Deferred (or jqXHR) object.

e.g. Running a test like this:

````coffeescript
it 'will stay the same after an error', ->
$.getJSON('foo/bar').fail ->
expect(foo.id).toEqual 'foo'
````

Will throw `Cannot call method 'fail' of undefined`

Mocking a jqXHR object would allow these callbacks to still work.

(Great project btw)