Skip to content

Instantly share code, notes, and snippets.

View ralphsmith80's full-sized avatar

Ralph ralphsmith80

View GitHub Profile
@aaronj1335
aaronj1335 / mockery.md
Last active December 14, 2015 19:38
mocking up a resource definition

summary

each resource file, say api/enamel/1.0/infoset.js, defines an ancestor of the Model class. the resource class has a __requests__ member that defines mesh/request instances for each request (get, put, post, query, delete, etc). each of these request instances has an ajax method that's just a reference to $.ajax, and it uses that do actually make the xhr.

'mocking' a resource amounts to the following: