I may be missing something but I am stuck in this scenario:
I have a non activerecord model, which I want to test. I have derived its test case class from: Test::Unit::TestCase.
However, the test case class for the model, uses within itself, other activerecord model classes and I want to load fixtures for them. My problem is that the fixtures class method is available only when I subclass the test case class from ActiveSupport::TestCase (it is defined within ActiveRecord::TestFixtures which gets included in ActiveSupport::TestCase).
Any help, coz running the tests gives me the error: undefined method “fixtures” (which is understandable) and in case I derive my test case class from ActiveSupport::TestCase it complains that there is no corresponding DB table. Also, I don’t want to create a dummy table for backing my model class.
Thanks a ton!
You can use
ActiveSupport::TestCasewithout the class being an ActiveRecord class (an example – but this project doesn’t use fixtures), so something else must be causing this. It must be something about how you are using fixtures, or your fixture configuration. Perhaps, by chance, do you have a fixture file for this non-AR model you are trying to test?