Skip to content

Instantly share code, notes, and snippets.

@blackrabbit99
Created September 25, 2015 09:15
Show Gist options
  • Save blackrabbit99/5cc594f790adf36e031e to your computer and use it in GitHub Desktop.
Save blackrabbit99/5cc594f790adf36e031e to your computer and use it in GitHub Desktop.
describe("spec", function () {
var server, fakeData = [ {a:1}, {b:2}, {c:3} ];
before(function () {
server = sinon.fakeServer.create();
server.respondWith(
"GET",
"https://myhost.local/url/5",
[200, { "Content-Type": "application/json" }, JSON.stringify(fakeData)]
);
});
it("test ajax", function (done) {
model.fetch().done(function(resp){
console.log('resp', resp);
});
server.respond();
});
after(function () { server.restore(); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment