From 9de127e75a2389edebdc7d410393b94a716f5ff9 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Mon, 13 May 2019 16:46:13 +0200 Subject: [PATCH] Change from rake Task to a single spec This has the advantage that if you run the whole suite it gets run automatically but if you run a single test it doesn't. This seems like the best of both worlds.. --- lib/tasks/factorybot.rake | 8 -------- spec/factorybot_lint_spec.rb | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 lib/tasks/factorybot.rake create mode 100644 spec/factorybot_lint_spec.rb diff --git a/lib/tasks/factorybot.rake b/lib/tasks/factorybot.rake deleted file mode 100644 index 7ae5e59..0000000 --- a/lib/tasks/factorybot.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/factorybot_lint_spec.rb b/spec/factorybot_lint_spec.rb new file mode 100644 index 0000000..1639768 --- /dev/null +++ b/spec/factorybot_lint_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'FactoryBot' do + it 'has valid factories' do + FactoryBot.lint + end +end