I have a feature that uses data from two separate database. This feature does not work when using cucumber-rails 1.0.2. The issue is that the first connection, to the regular Rails database, get stored as @@shared_connection in ActiveRecord::Base by the cucumber-rails active_record hook (lib/cucumber/rails/hooks/active_record.rb). After a connection to the second database is established, ActiveRecord::Base.connection still returns the @@shared_connection which is a connection to the wrong database.
A solution is to keep such a shared_connection per connection specification with which establish_connection has been invoked.
There are however other problems with this hook. For instance, it prevents you from writing features to test massively concurrent use of an application, by creating a bottleneck where the actual application has none.
The code was added in commit cbcfd88, but the commit message does not really explain why it was necessary.
Fix issue #152.
I can verify that @winnipegtransit's change has fixed the issue. I guess it won't be merged until it has tests though.
Forgot to close this