I have an app that uses subdomains to switch databases (multi-tenancy). I\'m trying to use Capybara for integration testing, and it really relies a lot on subdomains.
This guy has the right answer here:
http://zurb.com/forrst/posts/Testing_Subdomains_in_Capybara-g4M
You want to do
Capybara.current_session.driver.reset! Capybara.default_host = 'http://app.mydomain.com'