Monday, March 14, 2011

uninitialized constant ActiveRecord::TestFixtures

I saw this uninitialized constant ActiveRecord::TestFixtures error when i run the rake test. I have checked all the environment configuration. I am sure i am using Mongoid without ActiveRecord.

after reading the fixture_support.rb source code, I found out that the error is thrown only if ActiveRecord was called somewhere in my code. and it turned out to be caused by the Transition suggested by krzysiek:

So, I have to switch the state machine to another gem which is not using ActiveRecord stuff. that's why i found stateflow:

My test can run happily ever after.

1 comment: