Add config to allow running FactoryGirl lint before suit

By default the lint will be run before every test suit.
Set it to false in config.yml if you would rather just use the rake
task: `bundle exec rake factory_girl:lint`
This commit is contained in:
Aditya Prakash 2016-02-20 13:36:40 +05:30
parent f84150362b
commit 640be7497f
2 changed files with 11 additions and 0 deletions

View file

@ -15,6 +15,10 @@ defaults: &defaults
ichain:
enabled: false
# Set it to false if you don't want FactoryGirl lint to run before every test suit.
# You can run lint manually with: bundle exec rake factory_girl:lint
factory_girl_lint: true
development:
<<: *defaults

View file

@ -0,0 +1,7 @@
RSpec.configure do |config|
config.before(:suite) do
FactoryGirl.lint if CONFIG['factory_girl_lint']
end
end