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?
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.