Created
March 2, 2012 14:07
-
-
Save jfromaniello/1958575 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I put this next to the "respondWith" function inside sinon.js | |
respondWithJson: function (url, responseObject){ | |
this.respondWith(url, [200, { | |
"Content-Type": "application/json" | |
}, JSON.stringify(responseObject)]); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.server.requests = []; | |
//do something that will fire the request | |
assert... this.server.requests[0].requestBody, $.param({...}); | |
assert... this.server.requests[0].url, my url.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.server.respondWithJson("/notification/123", [{ | |
Name: "NOTJOSE", Message: "FooBarBaz"}]); | |
something.doSomethingThatWillFetchTheUrl(); | |
this.server.respond(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment