Created
January 6, 2014 16:06
-
-
Save caryfitzhugh/8285017 to your computer and use it in GitHub Desktop.
Suggestion
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
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). | |
req.respond( ...... ); // Not sure of the syntax, but look in other tests to fill in the ajax response. | |
// Now that the AJAX has completed, we hsould have the response_spy data | |
equal(response_spy.calledCount, 1); | |
// And verify some of the fields... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment