Skip to content

Instantly share code, notes, and snippets.

View codabrink's full-sized avatar

Dakota Brink codabrink

View GitHub Profile
var response_spy = sinon.spy();
$(document).on("recipes.response_details", response_spy);
$(document).trigger("recipes.request_details", { guid: "123"});
// Now there should be a pending AJAX request to the server.
var req = this.last_xhr_request();
// You can inspect it ot make sure it's going to the right URL, etc. (look at other tests).