Reputation: 24406
I use this command to run a unit test in rails:
$ ruby -Itest test/unit/post_test.rb
I get an error "Test is not a module (TypeError)" and no tests are run.
Could it be related to the fact that I have a model class named "Test"? If there is no way to make that work, what would be the fastest way to refactor and change the class name?
Upvotes: 2
Views: 2306
Reputation: 1557
I believe you're right that it's because you've created a model using a name you shouldn't use (Test in this case).
All you should need to do is:
Create a migration to rename the database table: (rename_table :oldname, :newname)
Upvotes: 5