fabricators_spec.rb 445 B

1234567891011121314
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. Fabrication.manager.load_definitions if Fabrication.manager.empty?
  4. Fabrication.manager.schematics.map(&:first).each do |factory_name|
  5. RSpec.describe "The #{factory_name} factory" do
  6. it 'is able to create valid records' do
  7. records = Fabricate.times(2, factory_name) # Create multiple of each to uncover uniqueness issues
  8. expect(records).to all(be_valid)
  9. end
  10. end
  11. end