Factories from engine not loaded

Open
#412 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rails, ruby, spring

Research direction

Start with factories.rb and the require of spree/testing_support/factories, then compare factory loading when RSpec or Cucumber runs directly versus through Spring. Reproduce with the listed Ruby, Rails, Spring, and FactoryGirl versions; done means the user factory is registered and usable under Spring as it is in the direct test runs.

Written by the indexing model from the issue text.

Description

bug

On an application that use Spree (for e-commerce), to use the factories, we do in factories.rb :

require "spree/testing_support/factories"

Factories work with launching Rspec and Cucumber directly but with Spring, it fails with:

ArgumentError:
   Factory not registered: user

I suspect this is related to engines because on another app with factories from an engine, we have the same error.

Spring 1.3.6
Ruby 2.2.2
Rails 4.2.3
FactoryGirl 4.5.0

Dominant language
Ruby
Stars
2.8k
Forks
342
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rails/spring

All issues in rails/spring

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.