开发者

How do I properly setup transactional fixtures in Rails?

开发者 https://www.devze.com 2023-01-07 14:58 出处:网络
I just started a new project yesterday and I\'m having a lot of very strange transactional fixture problems. It sounds like this is something of an issue with Rails, so I\'m hoping StackOverflow can h

I just started a new project yesterday and I'm having a lot of very strange transactional fixture problems. It sounds like this is something of an issue with Rails, so I'm hoping StackOverflow can help. Here's the rundown.

  • Coworkers can run tests fine. They are running Mac OS X; I'm running Ubuntu.

  • When use_transactional_fixtures is true, lots of tests fail with can't find [record] with ID=[some-id]. My coworkers run in this mode, but experience no problems.

  • If I set use_transactional_fixtures to false, almost all of the previously failing tests pass again. My coworkers don't see a difference, except that the tests run moderately slower since transactions aren't being used anymore.

  • When tests are run individually (rake spec SPEC=spec/some-specific-spec.rb) with fixtures on false, there is a failure in test #1,234, and only test #1,234.

  • When tests are run all together (rake spec) with fixtures on false, there is a failure in test #3,456, and only test #3,456.

  • These two tests are not related in any apparent way. There are a lot of tests (over 5,000), so it doesn't seem terribly surprising that there might be a coincidence happening.

What inferences would you draw from this situation, and how would you go abou开发者_如何学编程t fixing it?


Looks like there is an issue with latest rails-rspec2: http://github.com/rspec/rspec-rails/issues/issue/58

0

精彩评论

暂无评论...
验证码 换一张
取 消