dimanche 29 mars 2015

Sinon js call for PUT or POST methods

I am using sinon js in my project for fake server call. Its working fine for GET calls but I have a scenario in which I want to mock a server with PUT or POST call. I am doing it in this way:



server = sinon.fakeServer.create();
server.respondWith('PUT', /\/administration\/email/,
[204, { "Content-Type": "application/json" }, JSON.stringify(EmailModelFixture)]);





emailView.save("abc@gmail.com");
server.respond();// Responding that save call.


But this is not working. Any one know how to fix it?


Aucun commentaire:

Enregistrer un commentaire