Simplify DatabaseCleaner code example for linter (#1009)

The `cleaning` method already ensures cleaning and provides for a way to write better looking code.

This should be 100% equivalent to previous example.
This commit is contained in:
Diego Algorta 2017-09-28 09:25:58 -03:00 committed by Josh Clayton
parent 07b796ecce
commit 1924bc0602
1 changed files with 1 additions and 4 deletions

View File

@ -986,11 +986,8 @@ namespace :factory_girl do
desc "Verify that all FactoryGirl factories are valid"
task lint: :environment do
if Rails.env.test?
begin
DatabaseCleaner.start
DatabaseCleaner.cleaning do
FactoryGirl.lint
ensure
DatabaseCleaner.clean
end
else
system("bundle exec rake factory_girl:lint RAILS_ENV='test'")