Creating rspec files for existing model (beginner)

rspec, ruby-on-rails-4

Solution

First of all delete the `test` directory then run the following command

rails generate rspec:install

And if you are using bundler then use the following command instead

bundle exec rails generate rspec:install

It should create a `spec` directory in your rails root

In that directory you should find the following file among other directories `spec_helper.rb`

Then you can edit this file if you needed to

And to run the tests you should use the following command

 rspec

Or the following if you are using bundler

bundle exec rspec 

Problem

I have a Rails application with one model (following a tutorial) and I forgot to install the gem Rspec at inception. I have now done it but the Spec files and folders don't show up. I have read the following : How do I generate specs for existing controllers? and tried a few command lines that have generated files (am so noob I cant find out what it has actually done) But no new Spec files ! Would it be because I have a Model and not a Controller ? What would be the correct command line ? Alternatively may I create them directly and with what name?

Original source

Related problems