factory_bot
factory_bot copied to clipboard
A library for setting up Ruby objects as test data.
See: https://github.com/thoughtbot/factory_bot/issues/199 I have a number of clients who use FactoryBot and are working through the difficult challene of decomposing a large monolith into either domain-driven namespaces; or small gems/engines...
### Description After upgrading from Version 6.2.0 to 6.2.1 our custom strategy was broken. -> NoMethodError: undefined method 'to_sym' for CustomStrategy This commit broke our code https://github.com/thoughtbot/factory_bot/commit/1b81d5dc258e5f1ad25c5109cb4bf3f6be83deb4 The change is...
### Problem this feature will solve I often find myself creating multiple factories for a given model, for various reasons — e.g.: - fields with semantic constraints that can't easily...
See https://github.com/thoughtbot/factory_bot/issues/1536
As per https://github.com/rubygems/rubygems/pull/5337, we can simplify the steps of adding a gem.
When we release factory_bot 7, we should stop testing against any end-of-life Ruby versions (probably 2.5 and 2.6 by the time we release - https://www.ruby-lang.org/en/downloads/branches/). Similarly for Rails, we stop...
### Problem this feature will solve Currently, I can create a factory like this: ```ruby FactoryBot.define do factory :a do my_json_column do { "a" => 1, "b" => 2, "c"...
### Problem this feature will solve Our GETTING_STARTED file is overwhelmingly large. It isn't so much a guide for getting started with factory_bot as complete documentation for every factory_bot feature....
### Problem this feature will solve In a legacy codebase that has a large suite of factories, and a large chunk of them being invalid, it can be difficult to...
Closes #1498 When the primary key of a table has a type of `uuid` and when using the `build_stubbed` strategy, the `id` was not set properly. This PR checks if...