example of how to use with rspec

This commit is contained in:
bmabey 2009-03-10 21:52:15 -07:00
parent 75c0368d00
commit d6fb45ab70
1 changed files with 21 additions and 0 deletions

View File

@ -56,6 +56,27 @@ strategy the remaining time. To accomplish this you can say:
# then make the DatabaseCleaner.start and DatabaseCleaner.clean calls appropriately
</pre>
Example usage with RSpec:
<pre>
Spec::Runner.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.before(:all) do
DatabaseCleaner.start
end
config.after(:all) do
DatabaseCleaner.clean
end
end
</pre>
For use in Cucumber please see the section below.