mirror of
https://github.com/openSUSE/osem.git
synced 2026-01-24 05:48:40 -05:00
No need to do this before each and every spec or example. Speeds up suite and make things less fragile.
15 lines
384 B
Ruby
15 lines
384 B
Ruby
namespace :factory_bot do
|
|
desc "Verify that all FactoryBot factories are valid"
|
|
task lint: :environment do
|
|
if Rails.env.test?
|
|
conn = ActiveRecord::Base.connection
|
|
conn.transaction do
|
|
FactoryBot.lint
|
|
raise ActiveRecord::Rollback
|
|
end
|
|
else
|
|
raise "\nERROR: You should not run this outside the test environment...\n\n"
|
|
end
|
|
end
|
|
end
|