Sha256: 8c75601fc189a81b388425e3b4c5b7fabde2626fc8b4d34f0713588c916ec55a

Contents?: true

Size: 434 Bytes

Versions: 3

Compression:

Stored size: 434 Bytes

Contents

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 traits: true
        raise ActiveRecord::Rollback
      end
    else
      system("bundle exec rake app:factory_bot:lint RAILS_ENV='test'")
      raise if $CHILD_STATUS.exitstatus.nonzero?
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
federails-0.3.0 lib/tasks/factory_bot.rake
federails-0.2.0 lib/tasks/factory_bot.rake
federails-0.1.0 lib/tasks/factory_bot.rake