Include DatabaseCleaner usage when demoing FactoryGirl.lint

Because built factories create associated records, the database may not
be empty when the suite is run. This encourages developers to start
DatabaseCleaner and clean after linting is complete to ensure a clean
database.

Closes #619, #611, #620
This commit is contained in:
Joshua Clayton 2014-02-13 11:49:31 -05:00
parent ea03790b3e
commit 7f31ba9239
1 changed files with 9 additions and 1 deletions

View File

@ -88,11 +88,19 @@ RSpec.configure do |config|
# additional factory_girl configuration
config.before(:suite) do
FactoryGirl.lint
begin
DatabaseCleaner.start
FactoryGirl.lint
ensure
DatabaseCleaner.clean
end
end
end
```
After calling `FactoryGirl.lint`, you'll likely want to clear out the
database, as built factories will create associated records.
Defining factories
------------------