factory_bot icon indicating copy to clipboard operation
factory_bot copied to clipboard

A library for setting up Ruby objects as test data.

Results 102 factory_bot issues
Sort by recently updated
recently updated
newest added

This feature request came from https://github.com/rubocop/rubocop-factory_bot/pull/52 which has an example reproduction of the problem. ### Problem this feature will solve E.g. with a simple factory: ```ruby factory :post do sequence...

feature

### Description I use simple 1:n associations with models residing in a Rails Engine. The main app includes this engine directly under `/engines`. However, the validation fails for belongs_to associations...

bug

### Description When cloning the current repository on a case-insensitive file system git warns about path collisions: ``` git clone https://github.com/thoughtbot/factory_bot.git tmp … warning: the following paths have collided (e.g....

bug

Replacement for the prematurely closed PR #1518 Why: ---- When defining an association the block-argument will be ignored when also providing a `factory`-key on the association definition. This behaviour might...

I have upgraded my application from rails 5.2 to 6.1. and Ruby from 2.7 to 3.0 but when i rspec my test cases i got this error when i try...

bug

### Problem this feature will solve When working on a large codebase with factories (or traits in my case) that have common names, it's hard to grep/find all usages of...

feature

### Description Calling `FactoryBot.lint([my_factory], traits: true)` will create a factory with every trait it has defined. For most factories and traits, this is fine. However, when a nested factory uses...

bug

### Problem this feature will solve As ActiveStorage is a proper part of rails now, it would be nice if factory bot provided documentation for attaching a file as an...

feature

### Description We have the following factory. ` factory :business_partner do name { Faker::name } company { true } location client default_company { true } end ` The Factory works...

bug

### Problem this feature will solve At GitHub we've recently adopted [Sorbet](https://github.com/sorbet/sorbet) for type annotations in our Ruby code, and we make extensive use of factory_bot in our test suite....

feature