oreillymedia/backbone-github — pull request #1 by runemadsen (2013-06-28 13:56:05+00:00)
Title: Automate Creation of GitHubObjects and API Stubbing + Tests

Hi @zischwartz @sklise

Here's a pull request that automates the process of faking the GitHub API for our testing environments. Basically you run the Ruby script in `test/lib`, and it will:

1. Make numerous calls to the GitHub API and save the responses
2. Write the responses to the `gh_objects.js` file into a `GHObjects` JS var
3. Make it possible to run `GHAPI.fake(true)` to fake all requests to the GitHub API
3. Generate tests for all of the routes, making sure that the stubbing works

This means that the files `/test/lib/gh_objects.js` and `/test/spec/gh_api_spec.js` should never be edited manually. Instead, you run the Ruby script.

From now on we should use this file in every app we're using the GitHub API. I'll copy it to `spec/javascripts` in orm-atlas now, and make sure that the tests are working with it.

The most important thing is that in our tests, we can only fake loading the files that are in the following repo:
https://github.com/runemadsen/basic-sample. This is the repo against which I make the GitHub API calls in the Ruby script.

Let me know if you have any questions.