Use a previously-selected :dir from application.rb #73

Closed
wants to merge 1 commit into from

3 participants

@ernie

factory_girl_rails currently ignores a previously-supplied :dir option from application.rb, and therefore always generates factories at spec/factories when RSpec is being used.

This patch will respect the user-supplied option, if given.

@urbanautomaton

Great minds think alike - I opened pull request #64 a few months ago to address the same issue. :-)

@ernie

@urbanautomaton Yeah, sorry -- I noticed yours after I submitted mine :(

@joshuaclayton joshuaclayton commented on the diff Nov 2, 2012
lib/factory_girl_rails/railtie.rb
@@ -4,11 +4,12 @@
module FactoryGirl
class Railtie < Rails::Railtie
- initializer "factory_girl.set_fixture_replacement" do
- generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators
+ generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators
@joshuaclayton
thoughtbot, inc. member

Was this supposed to be moved outside of the initializer block? Does it have any implications surrounding loading etc.?

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