In my Rails application, I use PostgreSQL schemas, and not every schema contains all the tables. (This is especially true for the default path). This leads to some problems with loading the instrument in Test::Unit.
I set the search path of the circuit to setup, but if I turn on instruments using fixtures, they will be loaded before my setup changes the search path and the instruments cannot be loaded.
class ActiveSupport::TestCase
fixtures :model1, :model2
setup do
end
end
Is it possible to postpone the loading of fixtures until there is one setupor change the connection to the database before the fixtures are loaded? (Note: not all tests work on the same search path!)
Some background: existing tests from the old version without different schemes, so I don’t want to rewrite all tests using other means of generating test data, although for future tests I will definitely switch to factory_girl.
source
share