How come Factory Girl isn't sequencing unique attributes?

妖精的绣舞 提交于 2019-12-03 03:31:07

rake db:test:prepare seemed to fix the problem.

Not sure why, though. The schema hadn't been changed.

Please, consider using database_cleaner gem. One was designed specifically to fulfill the purpose of cleaning up database between test runs.

This post explains pretty much everything.

You should consider deleting all topics by hand in the end of the test. Of course, it is not number one solution but worked out for me real great.

after(:all) { Topic.delete_all }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!