Why isn't factory_girl operating transactionally for me? - rows remain in database after tests

前端 未结 5 1771
挽巷
挽巷 2020-12-24 12:04

I\'m trying to use factory_girl to create a \"user\" factory (with RSpec) however it doesn\'t seem to be operating transactionally and is apparently failing because of remna

5条回答
  •  盖世英雄少女心
    2020-12-24 12:29

    See my blog entry on the difference between using before :all and before :each with regard to transactions: http://mwilden.blogspot.com/2010/11/beware-of-rspecs-before-all.html. In a nutshell, before :all is not transactional, and data created there will stick around after the test is run.

提交回复
热议问题