backbone-generator/templates/spec_helper.coffee.erb

15 lines
335 B
Plaintext

window.withServer ->
jasmine.getEnv().withServer()
jasmine.Env.prototype.withServer ->
@currentSuite.beforeEach ->
@server = sinon.fakeServer.create()
@currentSuite.afterEach ->
@server.restore()
beforeEach ->
@validJSONResponse = (data) ->
[ 200, { 'Content-type': 'application/json' }, JSON.stringify(data) ]