AgileVentures/LocalSupport — pull request #44 by johnnymo87 (2014-05-02 05:27:00+00:00)
Title: WIP: RouteCollector for easy integration specs

Just posting this here for discussion & feedback ...

This branch is based off of `geocode-specs`, here is the [diff](https://github.com/johnnymo87/LocalSupport/compare/geocode-specs...shared_examples).

The idea here is that we may want to refactor a messy controller (e.g. `OrganizationsController`), but first we want to write more integration tests to make sure we don't break something. Unfortunately, we have eight actions in this controller, and it's a pain to manually write integration tests for every aspect of each of them.

The `RouteCollector` module seeks to make this easier by:
* programatically collecting boilerplate routing info for all the actions, including variables in the URL such as `id`
* allowing one to add extra info to the params hash where needed (usually `create` and `update`)
* matching URL variables to a given resource (e.g. getting the `id` needed for the `show` action for a given organization)

Included in this PR is an example acceptance suite that I might use when refactoring the `OrganizationsController` and then throw out after. Here is the [output](http://i.imgur.com/jQ8N6ee.png) in my terminal.