I have a functional test which fails when I run it normally. I have the ruby-debug gem installed, so I inserted a “debugger” line into the controller method and when I run the test it breaks on that line. I would then step through the remainder of the function, but it got to the exit point and it was correct (and then the test passed). After that I ran it again, and immediately when the debugger started I just hit “c” for continue. The test passed.
Does anyone have some suggestions on how to approach a problem like this? Are there some common mistakes that can lead to this situation?
I’m not completely sure because I don’t have access to the code you are testing. However, I once had a problem where there was data that took time outside of the controller. (For instance an ajax call on the page, or something using an event queue)
The debug just added enough of a delay that the data was there when I wanted to check it, but it wasn’t there if the debugger wasn’t included.
Would this sound like something going on in this test?