GitHub - aaltamar12/factory-patterns: FactoryBot patterns — traits, sequences, associations, and test data strategies · GitHub
Skip to content

About

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

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages