mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
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:
parent
07b796ecce
commit
1924bc0602
1 changed files with 1 additions and 4 deletions
|
@ -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'")
|
||||
|
|
Loading…
Reference in a new issue