thoughtbot / thoughtbot/factory_bot

Move stub strategy into factory_bot_rails

Open
#1,643 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Ruby
Stars
8.2k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

The stub strategy is specific to ActiveRecord. It exists to create a stub of ActiveRecord model instances. Therefore, it should live in factory_bot_rails.

My hope is that by doing this we'll need to refactor some code and add some hooks. This could allow for better hooks for adding strategies, meaning people could make more of their own.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing stub strategy and its ActiveRecord model-instance integration, then compare the responsibilities of factory_bot and factory_bot_rails. Done means the strategy lives in factory_bot_rails and the refactor establishes the requested hooks for adding strategies.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.