factory_bot icon indicating copy to clipboard operation
factory_bot copied to clipboard

A library for setting up Ruby objects as test data.

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

### Description We are modeling tree structures in with `UUID` primary keys. We specifically chose `UUID` as type because among other benefits we can generate those IDs in the application...

bug

### Problem this feature will solve Having `FactoryBot.automatically_define_enum_traits` default to true is useful when using `ActiveRecord::Enum` to get up and running with factories quickly. However this is an all-or-nothing option...

feature

Currently you can only specify whether to automatically define enum traits at a global level, through `FactoryBot.automatically_define_enum_traits`. This means that an entire codebase has to either opt-in, or opt-out from...

Hi, i m using factorybot to test my app with rspec and cucumber. With cucumber all test go well, with rspec i have this error: "duplication definition error, factory alredy...

The docs here use the worst example where the association happens to match the factory: https://github.com/thoughtbot/factory_bot/blob/main/GETTING_STARTED.md#overriding-attributes ``` factory :post do # ... author_last_name { "Writely" } author { association :author,...

test description ## Priority Support - @namproctin is using [Mintycode](https://mintycode.io) to fund this issue. - If you would like to accept ![amount](https://imageupload.io/ib/zwkd2EaAY6YpPsg_1693209112.png) bounty for solving this issue join [Mintycode](https://mintycode.io/profile?action=CREATOR_SUPPORT_MODAL&requestId=31648f50-fc9d-4a12-a13f-778dfe1caa5a&owner=thoughtbot&name=factory_bot). -...

### Problem this feature will solve I do not have enough knowledge to use FactoryBot. Also, some of my colleagues find it difficult to read English documentation. ### Desired solution...

feature
documentation

I'm working with STI and am customizing our `initialize_with` block. However, there are some conditions we'd like to put in place that require introspection on the class in question. It...

Replacement for #1581 ## Why are the changes necessary? See issue description at https://github.com/thoughtbot/factory_bot/issues/1580 ## What changes are proposed? The 2 conflicting file paths are: - `docs/src/summary.md`: An intro describing...

documentation

### Description hey team 👋🏻 I'm currently trying to move away from defining the `class` attribute as a class to a string. The thing is, in this project, for different...

bug