Skip to content

Instantly share code, notes, and snippets.

@graybill
Created September 16, 2011 19:46
Show Gist options
  • Save graybill/1222952 to your computer and use it in GitHub Desktop.
Save graybill/1222952 to your computer and use it in GitHub Desktop.
it("should make a server request from passed options", function() {
runs(function(){
var options = { endPoint: '/json/admin/user',
method: 'get_list',
data: {},
successCallback: function(res) {
// can i put a spy here to make sure the callback is fired?
console.log("SUCCESS")
console.log(res)
}
};
// Not using the spy correctly
spyOn(options, 'successCallback');
App.request(options);
expect(options.successCallback).toHaveBeenCalled()
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment