Skip to content

Commit 60ccb19

Browse files
authored
Merge pull request #172 from solidusio/kennyadsl/update-readme
Add instruction on how to use the new factories in apps
2 parents 7e1a22d + 105bc36 commit 60ccb19

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • lib/solidus_dev_support/templates/extension

lib/solidus_dev_support/templates/extension/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,17 @@ bundle exec rubocop
4242
```
4343

4444
When testing your application's integration with this extension you may use its factories.
45-
Simply add this require statement to your spec_helper:
45+
Simply add this require statement to your `spec/spec_helper.rb`:
4646

4747
```ruby
48-
require '<%= file_name %>/factories'
48+
require '<%= file_name %>/testing_support/factories'
49+
```
50+
51+
Or, if you are using `FactoryBot.definition_file_paths`, you can load Solidus core
52+
factories along with this extension's factories using this statement:
53+
54+
```ruby
55+
SolidusDevSupport::TestingSupport::Factories.load_for(<%= class_name %>::Engine)
4956
```
5057
5158
### Running the sandbox

0 commit comments

Comments
 (0)