modeset/teaspoon — pull request #135 by rjackson (2013-11-29 16:01:20+00:00)
Title: Add ability to configure hooks.

Adds custom callback hooks to be executed when triggered by a POST to `/:suite/hooks/:group`.

This is helpful in our application to allow better integration testing while still being able to reset the database at key intervals.

We are using the following:

```ruby
# config/initializers/teaspoon.rb

Teaspoon.setup do |config|

config.suite do |suite|
suite.hook :clean do
DatabaseCleaner.clean
end
end
end
```

```javascript
// support/cleanDatabase.js (required from test_helper.js)
window.cleanDatabase = function(suite){
if (!suite) { suite = 'default' };

jQuery.ajax('/teaspoon/' + suite + '/hooks/clean', {
async: false,
type: 'POST'
});
}
```