Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
describe "App.request", ->
deferred = null
beforeEach ->
deferred = $.Deferred()
sinon.stub(App, "request").returns deferred.promise()
afterEach ->
App.request.restore()
it "res should be 'ok'", (done) ->
App.request("foo:bar:baz").done (obj) ->
expect(obj.res).to.be "ok"
done()
deferred.resolve res: "ok"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.