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..a75aa6f --- /dev/null +++ b/spec/factorybot_lint_spec.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# spec/lint_spec.rb + +require 'rails_helper' + +RSpec.describe 'Lint' do + it 'FactoryBot factories' do + conn = ActiveRecord::Base.connection + conn.transaction do + FactoryBot.lint + raise ActiveRecord::Rollback + end + end +end