CenturyLinkLabs/panamax-api — pull request #246 by dpetersen (2014-11-10 18:35:15+00:00)
Title: Explicitly define required fixtures in tests.

The global fixture setting causes dozens of rows to be created and then
rolled back on every test. I feel like it's clearer when you're testing
(or reading the test) about what's involved with a system when you have
to state which fixtures you need in the context it will be used. It has
a side-effect of being significantly faster (23s to 9s on my test machine).

I tried to put each `fixtures` statement at the lowest context that it was required within reason. There are a number of cases (particularly controller specs) where a fixture is needed in 4 out of 5 contexts and I just dropped it at the root of the spec for conciseness. In a couple of cases (`apps_controller_spec` particularly) I had to be a little more verbose because half of the actions were tested with the real database records and half were mocking it out, and I wanted to be more explicit to make that clear.

In addition, while I was roaming around I found a couple of weird test cases where it looks like folks missed writing tests but did write text indicating that a test should exist. I'll call them out in comments based on the blame and see if they want to write the test or whether I should just delete them.