thoughtbot/capybara-webkit — Issue #232: rack_test first, then @javascript => OK!; @javascript first, then rack_test => FAIL :(
Author: vitobotta
Created: 2011-12-25 23:00:22+00:00
State: open

Hi,

I am stuck with a very weird issue and was wondering whether anybody here could give some help.
I am using capybara with capybara-webkit for the @javascript enabled scenarios, and the default rack_test driver for all the other scenarios.

The weird thing is that, give one sample feature with just one normal scenario (rack_test) and another @javascript enabled scenario, the following happens:

1) if I run each scenario individually, both run fine;
2) if I run the whole feature, and the @javascript scenario is the last one/follows the rack_test one, all is OK.
3) BUT if I invert the order and have the @javascript scenario first and then the normal one, the JavaScript scenario passes while the second one fails with "Capybara::InfiniteRedirectError".

Any idea? I have been looking for wrong redirections etc in my app but I can't find anything that would explain this behaviour and anyway, as said, the problem only happens unless the @javascript scenarios follow the normal ones, in which case all scenarios pass.

What could possibly change depending on whether @javascript tagged scenarios come first or after?
I could post some code snippets if you suggest what you would need to check.

I've also posted the same issue to the Capybara project (https://github.com/jnicklas/capybara/issues/581) as I am not sure of where this would belong.

Thanks in advance!