Skip to content

Instantly share code, notes, and snippets.

@koba04
Last active August 29, 2015 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save koba04/e0c1016e80fc19c71192 to your computer and use it in GitHub Desktop.
Save koba04/e0c1016e80fc19c71192 to your computer and use it in GitHub Desktop.
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