I'd like to use hspec-wai in the following way:
- create a database before all my tests
- use that database to construct my wai application
- around each test, reset the database
- inside some tests, access the database directly to do some set up that's not supported by my public REST API
I think this is a pretty standard set of things to want to test. However, it's really hard to figure out how to do this with hspec & hspec-wai. I'm cobbling something together now (will post if I finish it), but it has taken a lot of time to figure it out, with a lot of searching down dead ends.
I would really appreciate concrete examples for doing the above. I think they'd make a good addition to the documentation.