Auto-generated rspecs

115 views Asked by At

I am working on an existing RoR app which was written a few years ago. It's testers were less than satisfying so the whole /spec directory was removed and I have to write new rspecs. I have seen somewhere that it is possible to generate non-blank rspecs using scaffold method. When I tried doing

rails generate scaffold rspec:model User

I got the lovely result of

invoke  active_record
/home/guy/railsProjects/netAdmin/vendor/ruby/2.0.0/gems/railties-4.1.6/lib/rails/generators/base.rb:258:in `const_defined?': wrong constant name Rspec:model (NameError)
    from /home/guy/railsProjects/netAdmin/vendor/ruby/2.0.0/gems/railties-4.1.6/lib/rails/generators/base.rb:258:in `block in class_collisions'

how do I work it out? having something that will write some of the specs, based on the existing models and controllers will save me tons of time. Thanks in advance!

0

There are 0 answers