Upgrade FactoryGirl to FactoryBot - #50768
Merged
Merged
Conversation
Specifically target a version `>= 4.8.2` to prepare for a switch to `factory_bot_rails`, which this gem was renamed to.
Mostly just following the documentation at https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md: ```bash git grep --name-only FactoryGirl | xargs sed -i "s/FactoryGirl/FactoryBot/" git grep --name-only factory_girl | xargs sed -i "s/factory_girl/factory_bot/" ```
Hamms
marked this pull request as ready for review
March 15, 2023 23:54
cat5inthecradle
approved these changes
Mar 16, 2023
bencodeorg
approved these changes
Mar 16, 2023
Hamms
added a commit
that referenced
this pull request
Mar 22, 2023
The very latest version of the library, now that we can do so; follow-up to #50768. Specifically target a version `>= 6.2.0` to pick up support for Ruby 3.0, in preparation for an eventual update to that version: https://github.com/thoughtbot/factory_bot/releases/tag/v6.2.0
This was referenced Mar 22, 2023
Merged
Hamms
added a commit
that referenced
this pull request
Apr 25, 2023
* Update `factory_bot` to 6.2.1 The very latest version of the library, now that we can do so; follow-up to #50768. Specifically target a version `>= 6.2.0` to pick up support for Ruby 3.0, in preparation for an eventual update to that version: https://github.com/thoughtbot/factory_bot/releases/tag/v6.2.0 * update add_attribute call to reflect deprecated static attributes * remove deprecated FactoryBot.allow_class_lookup * persist through association * create rather than build enrollment object that we want to validate, so that its associated records are also persisted and able to be validated * explicitly create some test records that need their associated records to be persisted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This gem was renamed, and the name we're using is no longer receiving updates.
Mostly just following the documentation at https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md:
Also update from 4.7.0 to 4.8.2 while we're at it; no significant changes between those versions, and the Girl to Bot transition should be entirely seamless.
Links
Follow-up work
After this, we probably want to continue to update the version we target; at least to v4.11.1, possibly all the way to v6.x