From be89152cb191360f9324d875c8ada432676493b2 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Thu, 2 May 2019 13:31:04 +0200 Subject: [PATCH] Lint factories before spec suite This also removes the rake task and implements Factory linting as before(:suite) which is not recommended by the FactoryBot guys, but we decided to implement it that way as it does not need to be configured within CI explicitly. --- lib/tasks/factory_bot.rake | 8 -------- spec/spec_helper.rb | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 lib/tasks/factory_bot.rake diff --git a/lib/tasks/factory_bot.rake b/lib/tasks/factory_bot.rake deleted file mode 100644 index 7ae5e59..0000000 --- a/lib/tasks/factory_bot.rake +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -namespace :factorybot do - desc 'Lint FactoryBot factories' - task lint: :environment do - FactoryBot.lint - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9e55c9c..3cc5e12 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,6 +23,7 @@ RSpec.configure do |config| # assertion/expectation library such as wrong or the stdlib/minitest # assertions if you prefer. + config.before(:suite) { FactoryBot.lint } # only runs tests with " , focus: true " # config.filter_run focus: true