mirror of
https://github.com/thoughtbot/factory_bot_rails.git
synced 2022-11-09 11:49:18 -05:00
Add factory_bot_rails transition instructions
This commit is contained in:
parent
fa893913ec
commit
018c9158c4
1 changed files with 15 additions and 0 deletions
15
README.md
15
README.md
|
@ -6,6 +6,21 @@ instances, attribute hashes, and stubbed objects), and support for multiple
|
|||
factories for the same class (`user`, `admin_user`, and so on), including factory
|
||||
inheritance.
|
||||
|
||||
### Transitioning from factory\_girl\_rails?
|
||||
|
||||
Transitioning is a two step process:
|
||||
|
||||
1) Replace `factory_girl_rails` with `factory_bot_rails` in your Gemfile
|
||||
and `bundle install`
|
||||
|
||||
2) Rename all `FactoryGirl` to `FactoryBot` and `factory_girl` to `factory_bot`
|
||||
in your codebase.
|
||||
|
||||
This command will perform a `FactoryGirl` to `FactoryBot` rename within your
|
||||
`spec/` directory:
|
||||
|
||||
```ag -0l FactoryGirl spec | xargs -0 sed -i 's/FactoryGirl/FactoryBot/g'```
|
||||
|
||||
## Rails
|
||||
|
||||
factory_bot_rails provides Rails integration for [factory_bot][fb].
|
||||
|
|
Loading…
Reference in a new issue