After making a new rails 3.2.3 application, I generated a new scaffold to play around with some code. I was running some rake tasks later on and accidentally entered ‘rake’ without any arguments. To my surprise, it ran 7 tests and 10 assertions with 0 failures… Why? I didn’t add any tests to the application.
Were these tests generated with the scaffold? It appears that the tests are located in the /test directory. I want to use rspec, not test::unit or anything like that. If this is something other than rspec, is it safe to just deleted the /test directory or is there more underlying work to remove this?
Yes! The tests are generated along with the scaffolding. They don’t do much more than
assertthat the scaffold controller is routing correctly, but you can safely remove them. It’s probably best to remove the test files themselves rather than the entiretestdirectory (just in case you end up having any use forTest::Unitdown the line), but you can find all of the generated tests in the following subdirectories: