Skip to content

Instantly share code, notes, and snippets.

@searls
Created December 15, 2011 19:28
Show Gist options
  • Save searls/1482464 to your computer and use it in GitHub Desktop.
Save searls/1482464 to your computer and use it in GitHub Desktop.
expect($.fn.ajax).toHaveBeenCalledWith({
url: "/1/3/3"
success: jasmine.any(Function);
});
//....
var callback = $.fn.ajax.mostRecentCall.args[0].success
//then you can write tests directly against the callback handler.
callback()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment