Example to lint FactoryBot factories with RSpec.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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