Skip to content

Instantly share code, notes, and snippets.

@markfeedly
Created November 22, 2013 17:37
Show Gist options
  • Save markfeedly/7603865 to your computer and use it in GitHub Desktop.
Save markfeedly/7603865 to your computer and use it in GitHub Desktop.
DRY factories
if I have spec/factories and features/factories then is it all dry
eg I only need to add a factory used by rspec and cucumber in one of these directories?
I'd add spec/factories, see how it goes
if it doesn't 'just work', then put something like
Dir[Rails.root + "spec/factories/*.rb"].each {|f| require f}
inside a features/support/factory_girl.rb file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment