ontohub/ontohub — pull request #915 by eugenk (2014-06-04 08:21:39+00:00)
Title: 855 proper database cleaning

This fixes #855 and #234: The database is cleaned before the test suite and after each test. Also, the Rake task `db:test:purge` is overwritten to simply invoke `db:migrate:clean` and the stubs are removed because we don't need them in this setup any more.

The rake task `db:purge` originally simply recreated the database structure:
```ruby
task :purge => [:environment, :load_config] do
abcs = ActiveRecord::Base.configurations
case abcs['test']['adapter']
when ...
when /postgresql/
ActiveRecord::Base.clear_active_connections!
drop_database(abcs['test'])
create_database(abcs['test'])
when ...
else
raise "Task not supported by '#{abcs['test']['adapter']}'"
end
end
```