Is there a way to remove all spec tests belonging to deleted controllers?

I am in the process of stripping down a huge app, and in the process deleting many controllers. When running rspec, I'm getting NameError (uninitialized constant) for all of these tests that no longer have corresponding classes. Instead of removing these one by one, is there a way to automatically delete all these tests?

Answers


rails destroy controller foo should remove the specs, views, helpers, etc.

Run with the --pretend option to see what would happen if you actually ran it.

Usage: rails destroy GENERATOR [args] [options]

General options:
  -h, [--help]     # Print generator's options and usage
  -p, [--pretend]  # Run but do not make any changes
  -f, [--force]    # Overwrite files that already exist
  -s, [--skip]     # Skip files that already exist
  -q, [--quiet]    # Suppress status output

I don't know if there's a way to automatically remove specs for things that have already been deleted, although I suppose you could look at the spec filenames and do it yourself via a small script.


Need Your Help

Laravel and Codeception - test fails on PUT forms

php forms laravel laravel-5 codeception

I have a resource controller in laravel to manage my users. This creates a route to update users info that takes a request with HTTP PUT method.

How can stop Homebrew installing Postgres as root?

ruby database postgresql rvm homebrew

I have a Postgres permissions problem, every time i brew install postgres it does so as root user resulting in permissions denial on initdb, createdb and or anything else i try.