Skip to content

FactoryGirl definitions not found if FactoryGirl required before Combustion.initialize! invoked #33

@apsoto

Description

@apsoto

Things started breaking for me with 'Factory not registered' errors. I tracked it down to adding the 'factory_girl_rails' gem to my Gemfile. Bundler autorequires it, which was causing FactoryGirl.definition_file_paths to already be resolved to spec/internal for it's factories.

I worked around it by disabling autorequiring in my Gemfile:

gem 'factory_girl_rails', :require => false

And then manually requiring it in my spec_helper.rb after Combustion.initialize!:

Combustion.initialize!
require 'rspec/rails'
require 'factory_girl_rails'

However, it might be nice if Combustion can somehow fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions