octokit/octokit.rb — pull request #377 by joeyw (2013-12-15 01:16:44+00:00)
Title: Fix the insanity inducing problems with the tests

Short story: Right now you can clone octokit, set all test tokens to 'api-padawan' and the tests will all pass. Try to use any other tokens and you get multiple failures and this lovely output: https://gist.github.com/joeyw/7967090.

Long story: I have been wrecking my brain all week trying to figure out why the tests dont work and were having all kinds of problems with requests not matching. They weren't matching because the tests used the same login as the test token login, ie calling `@client.received_events("api-padawan")` when `OCTOKIT_TEST_GITHUB_LOGIN='api-padawan'` so when the request was saved by vcr, instead of having the url `"/users/api-padawan/received_events/public"` in reality it was saved as `"/users//received_events/public"` therefore not actually matching unless the token was set to `api-padawan` which is also replaced on repeat runs with.... ``. So there you have it. One massive headache resolved.

Also in f0fe7aa we have a spec asserting a URL. In the method it uses the current users auth login, in this case again `api-padawan` which works fine as long as you are `api-padawan` so we fix that by using the `#{test_github_login}`. My personal opinion at this point on asserting the url was request is that it is dumb, test the data that is returned and if it wasn't made then your data won't come back, but thats just my own rant.

I hope this makes sense I got more excited about figuring this out than one probably should. Good luck and God speed in your octokit ventures.