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

I couldn't determine what the purpose of the Null Strategy is, given that it's only used in the `AttributesFor#association` and simply returns `nil`. I tried substituting that method call for...

### Description `FactoryBot.modify` doesn't allow changing a factory's class. It's not explicitly mentioned in the docs, so this could reasonably be classified as a feature request. Though I rather expected...

bug

### Description FactoryBot throws an error when defining factories that refer to classes within modules in non-Rails applications. FactoryBot will work, but the class used by the factory must be...

bug

Due to https://github.com/thoughtbot/factory_bot/blob/b223c275191985f776ff294825660fce98b3c0cc/lib/factory_bot/evaluator.rb#L10 methods like `singleton_method_added` (coming from BasicObject) are undefined. And then https://github.com/thoughtbot/factory_bot/blob/b223c275191985f776ff294825660fce98b3c0cc/lib/factory_bot/evaluator.rb#L81 will actually call `singleton_method_added`, and since the method is not there, will end up in `method_missing`:...

This can either be an improvement or something to add to the documentation as suggested by [Daniel J Colson on Twitter](https://twitter.com/dodecadaniel/status/1088507598654136320). The simple feature is to, at least, use RSpec's...

feature

Given this this class and this factory definition: ```ruby DataClass = Struct.new(:x, :y, :z) FactoryGirl.define do factory :parent_factory, class: DataClass do x 1 trait :y do y 1 end trait...

In our rails app, we had some code like this: ```ruby class Account < ApplicationRecord belongs_to :unit validates_presence_of :number validates_uniqueness_of :number, scope: :unit_id, message: "Number has to be unique for...

bug

Co-authored-by: Daniel Colson Co-authored-by: Frida Casas

I have searched the issue list for something similar, but I have not found the exact same issue. The problem is that, given these two models: ```ruby factory :employee do...

documentation

* Hound is no longer used for linting and now the project uses standard * Remove unused hound.yml file