Skip to content

aaltamar12/factory-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

factory-patterns

Demonstrates advanced FactoryBot patterns for complex Rails test data setup.

What this shows

  • Traits for variant states (active, suspended, admin)
  • Transient attributes for conditional factory logic
  • after(:create) callbacks for association chains
  • build_stubbed for fast unit tests without DB hits
  • Sequence helpers for unique attributes
  • Nested associations without N+1 factory calls

How to run

bundle install bundle exec rspec bundle exec rspec spec/factories/ bundle exec rspec spec/models/

About

FactoryBot patterns — traits, sequences, associations, and test data strategies

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages