Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example to lint FactoryBot factories with RSpec.
require 'rails_helper'
RSpec.describe 'FactoryBot factory' do
FactoryBot.factories.each do |factory|
describe factory.name.inspect do
it 'creates valid record' do
expect { FactoryBot::Linter.new([factory]).lint! }.not_to raise_error
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment