I am building up an integration test suite and there is one bit of logic that I need to have a clean database for. How can I run the db:test:purge
task inside of one of my tests?
I am using: ruby 1.9.2, rails 3.0.9, rspec 2.6
You can invoke Rake tasks as following:
require 'rake'
Rake::Task[name].invoke
In this case this would result in the following code:
require 'rake'
Rake::Task['db:test:purge'].invoke