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

The latest TruffleRuby release (22.2.0) is compatible with CRuby 3.0 so now they will be check on CI against the same Rails versions. TruffleRuby CI builds fail on Rails 5.0,...

This renames all references to `master` to `main`. The `master` branch is no longer up to date, so these links go to outdated docs. There was one in `.gitignore` that...

Hi, I've been looking for a nice way to generate nested attributes with FactoryBot. There are already quite a few posts about this but I didn't find a solution which...

In a sufficiently large codebase, the automatic definition of traits for Active Record enum (#1380) may result in more combinations being checked by `FactoryBot.lint`. This breaking change may not be...

I accidentally typed ```ruby factory :thing, Thing do # ... end ``` and was confused by the error message. This commit ensures that the options are a Hash, and gives...

Related: https://github.com/thoughtbot/factory_bot/issues/385 On a current project we have a trait that looks like this: ```rb trait :with_profile_image do transient do profile_image_file { Rails.root.join("spec", "fixtures", "jpeg.jpg") } end after :build do...

feature

We have had several issues over the years related to `FactoryBot.aliases`: #522 #734 #851 #989 #1096 #1138, #1417. In most of these issues people do not realize that `factory_bot` assumes`{attribute}_id`...

in response to [Issue](https://github.com/thoughtbot/factory_bot/issues/1452). goal is to allow _prefix and _suffix for enum trait definitions to stay in line with ruby implementations also will not define the standard enum (without...

https://github.com/thoughtbot/factory_bot/issues/1540

### Description From my understanding, based on the [acceptance spec here](https://github.com/thoughtbot/factory_bot/blob/main/spec/acceptance/build_spec.rb#L33-L39), `use_parent_strategy` should be `true` if we _do not_ want to save associations. Should the corresponding example in the [build...

bug