From 018c9158c4d840b93376617fc95a395f6891f4df Mon Sep 17 00:00:00 2001 From: Avielle Wolfe Date: Sat, 21 Oct 2017 14:30:20 -0400 Subject: [PATCH] Add factory_bot_rails transition instructions --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 6517951..92eaa1c 100644 --- a/README.md +++ b/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].