batmanjs/batman — pull request #773 by nsimmons (2013-07-18 20:37:06+00:00)
Title: auto route testing

Hey, here's the first revision of the auto route/action testing.

paired with @ibawt

@kristianpd
@nickjs
@SoapyIllusions

there's some wierdness in the bindings initialization, and we probably missed some iterator binding things but the gist of it is:

- setup: grab all the html for the named routes and stuff them in the view store
- whenever someone calls assertRoutes() we go through the routes for the given controller as well any custom ones

# use case is like this
``` coffee-script
@test 'named routes', ->
params =
index:
preAction: =>
@expectLoad Shopify.Blog, { response: Shopify.Blog.createFromJSON(Fixtures.Blogs.myblog) }

show:
params: { id: 0 }
preAction: (controller) =>
@stub(controller,'_forceNestedEditRoute')
@expectFind Shopify.Article, { response: Shopify.Article.createFromJSON Fixtures.Articles.mypost }

@assertRoutes(params)
```

## caveats
Have to use jquery to fetch the HTML instead of batman.request as it's stubbed out by this point