我正在将我的应用程序升级到 Rails 3。我开始将 Rspec 2 与 Rails 3 一起使用。我需要关闭一些 rspec 测试的事务性固定装置。之前我在我的模型规格中使用了以下代码
before(:all) do
ActiveSupport::TestCase.use_transactional_fixtures = false
end
after(:all) do
ActiveSupport::TestCase.use_transactional_fixtures = true
clean_engine_database
end
这现在给了我错误:
Failure/Error: ActiveSupport::TestCase.use_transactional_fixtures = false
undefined method `use_transactional_fixtures=' for ActiveSupport::TestCase:Class
有没有办法在带有 Rspec 2 的 Rails 3 中为每个测试块执行此操作?