ActiveRecord Rollback does not work in Rails test

后端 未结 2 871
眼角桃花
眼角桃花 2020-12-20 05:18

Throwing ActiveRecord::Rollback works, but not in tests.

I\'ve had this problem before, am now having it again, and for some reason can\'t find any record of someone

2条回答
  •  情歌与酒
    2020-12-20 05:37

    Actually the method to call is as follows:

    class RollbackTest < ActiveSupport::TestCase
      self.use_transactional_fixtures = false
    

    not self.use_transaction_fixtures (note the missing 'al')

提交回复
热议问题