cucumber/cucumber-rails — Issue #186: rack_test first, then @javascript => OK!; @javascript first, then rack_test => FAIL :(
Author: vitobotta
Created: 2011-12-25 23:03:35+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 cucumber (1.1.4), cucumber-rails (1.2.1), capybara (1.1.2) with capybara-webkit (0.7.2) 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 (https://github.com/jnicklas/capybara/issues/581) and Capybara-Webkit (https://github.com/thoughtbot/capybara-webkit/issues/232) projects as I am not sure of where this would belong.

Thanks in advance!