Just spent a good bit of time trying to figure out why I couldn't get fixtures to work in a plugin test. I was including ActiveRecord::TestFixtures into ActiveSupport::TestCase and trying to get fixtures to automatically reload for every test like regular Rails tests.
The problem was in the first line of ActiveRecord::TestFixtures.setup_fixtures:
return unless defined?(ActiveRecord) && !ActiveRecord::Base.configurations.blank?
This causes setup_fixtures to silently return without doing anything if you call ActiveRecord::Base.establish_connection directly without setting ActiveRecord::Base.configurations. The method doesn't appear to actually use the configurations.
Is there some reason for this behavior? It appears like it should be removed to me, but if it is there for a reason, maybe it can be documented that populating configurations is a prerequisite to using fixtures in plugins.
I am using 2.3.5 but it appears to still be the case in edge.