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 I've noticed a significant performance hit when running rspec tests whenever there is a factory that populates an `hstore` column. ### Reproduction Steps Create an `hstore` column and...

bug

### Description I apologies first if I'm not in the right place to ask/report. I got the Rubocop `Rails/SaveBang` error triggered when I want to create FactoryBot object, using a...

bug

### Description When using SQLServer and 'uuid' as the primary key type, they 'build_stubbed' method does not automatically fill the id column. I would assume that this is filled independent...

bug

## Problem Cloning the `thoughtbot/factory_bot` repo on a case-insensitive file system (the default for macOS) results in the following message: ``` warning: the following paths have collided (e.g. case-sensitive paths...

### Description The `before(:create)` block is not getting executed in the order I expect when using `instance` in one of the factory's associations. I'm trying to update an existing factory...

bug

👋 Thanks for the review in advance - This PR Adds Ruby 3.3 to the CI matrix.

### Description According to [the docs](https://github.com/thoughtbot/factory_bot/blob/bd0a10c5ab9f93425beeba2ab17e503dceb368ab/docs/src/ref/build-strategies.md?plain=1#L55-L59), `attributes_for` constructs a hash using `initialize_with`, but this isn't actually the case. Is this a bug, or incorrect documentation? ### Reproduction Steps Reproduction script:...

bug

### Description Hi team! I noticed that FactoryBot is executing the associations block even when I'm using `attributes_for`. When I have one block which depends on another association, ruby is...

bug

### Problem this feature will solve We use a slightly unconventional ID scheme in our DB. Rather than the usual auto-incrementing IDs or UUIDs, we use string IDs like those...

feature