I realised a headless browser is overkill for just verifying the generated html, so I've switched it to just do a Net::HTTP.get.
I also greatly simplified the integration specs (all the lets and shared examples were making it unintelligible) and added a custom matcher, both of which make the failure messages much more informative.
And now Rubinius works again!
Make integration spec failures more descriptive
Hrm, why not to use Capybara with Rack::Test?
Draper's behaviour is quite different between test, development, and production environments, so we need to be sure that the integration tests are exercising these differences.
If we use Rack::Test, can we run in the different environments? And does Rails treat the requests the same way as a real request?
I'm not sufficiently familiar with Rack::Test to answer those questions, so I just went for the explicit approach (following focused_controller) because by running the real server we can be sure we're testing the real behaviour.
Seems good. Even if we can use Rack::Test, this is an improvement for now. Thanks a lot @haines