Skip to content

Commit acc095e

Browse files
r7kamurapurinkle
authored andcommitted
Fix docs about definition file paths
1 parent 5f9e369 commit acc095e

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

GETTING_STARTED.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,12 @@ Factories can be defined anywhere, but will be automatically loaded after
255255
calling `FactoryBot.find_definitions` if factories are defined in files at the
256256
following locations:
257257

258+
factories.rb
259+
factories/**/*.rb
258260
test/factories.rb
261+
test/factories/**/*.rb
259262
spec/factories.rb
260-
test/factories/*.rb
261-
spec/factories/*.rb
263+
spec/factories/**/*.rb
262264

263265
### Static Attributes
264266

docs/src/defining/file-paths.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Factories can be defined anywhere, but will be automatically loaded after
44
calling `FactoryBot.find_definitions` if factories are defined in files at the
55
following locations:
66

7+
factories.rb
8+
factories/**/*.rb
79
test/factories.rb
10+
test/factories/**/*.rb
811
spec/factories.rb
9-
test/factories/*.rb
10-
spec/factories/*.rb
12+
spec/factories/**/*.rb

docs/src/ref/find_definitions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The load order is controlled by the `FactoryBot.definition_file_paths`
77
attribute. The default load order is:
88

99
1. `factories.rb`
10+
1. `factories/**/*.rb`
1011
1. `test/factories.rb`
1112
1. `test/factories/**/*.rb`
1213
1. `spec/factories.rb`

lib/factory_bot/find_definitions.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ module FactoryBot
22
class << self
33
# An Array of strings specifying locations that should be searched for
44
# factory definitions. By default, factory_bot will attempt to require
5-
# "factories.rb", "factories/**/*.rb",
6-
# "test/factories.rb", "test/factories/**.rb",
7-
# "spec/factories.rb", and "spec/factories/**.rb".
5+
# "factories.rb", "factories/**/*.rb", "test/factories.rb",
6+
# "test/factories/**.rb", "spec/factories.rb", and "spec/factories/**.rb".
87
attr_accessor :definition_file_paths
98
end
109

0 commit comments

Comments
 (0)