I am using the rspec_rails
and factory_girl_rails
gems within my Rails project. All of the models are already created. Is there a generator that I can run that will create the factory file for an existing model?
Ex: I already have a Blog
model. RSpec allows me to generator a model spec file at spec/models/blog_spec.rb
by simply running the following:
rails generate rspec:model blog
Is there a generator that I can run in the command line that will generate the factory file for this existing model, located at: spec/factories/blogs.rb
?
I did not see any mentions of generators within the factory_girl_rails docs.
rails g factory_bot:model Blog
. – Spree