Commit 1b80bc9
committed
Reload after changing file paths to play nice with FactoryBotRails
FactoryBotRails calls find_definitions in it's railtie as rails initializes and
we can't assume we're the first one to call. Instead we call reload, which
will reset things and then call find_definitions.
find_definitions isn't reentrant so if it's already run, a second call will try to
register the same factories from the same files and lead to the following
error:
```
FactoryBot::DuplicateDefinitionError:
Factory already registered: account
```1 parent 1da4461 commit 1b80bc9
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
0 commit comments