Skip to content

Instantly share code, notes, and snippets.

@nbryan
Created June 24, 2011 21:55
Show Gist options
  • Select an option

  • Save nbryan/1045773 to your computer and use it in GitHub Desktop.

Select an option

Save nbryan/1045773 to your computer and use it in GitHub Desktop.
# Factory Girl doesn't traverse down directories, make sure these factories get loaded.
Dir[File.join(File.dirname(__FILE__), 'factories', '**/*.rb')].each {|file| require file}
@nbryan
Copy link
Author

nbryan commented Jun 24, 2011

I put this in my spec_helper.rb file. It looks like Factory Girl only traverses the top-level factories directory if it exists and no subdirectories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment