Reputation: 43401
When I generate a model using:
$ rails g model example
Rails generates a factory for the model. Currently it adds the factory to test/factories
however I need it to add the factory to spec/factories
.
I'm using RSpec and everything else is generated to spec/…
.
Upvotes: 1
Views: 550
Reputation: 6025
Normally, the place where these files end up, is determined by a directive in the file config/application.rb:
class Application < Rails::Application
config.generators do |g|
...
g.fixture_replacement :factory_girl, dir: 'spec/factories'
...
end
...
Upvotes: 4