Compatibility with Capybara 2.x.

Tests pass on 2.0.2, 2.1.0, 2.2.1, 2.3.0, and 2.4.1.