Integration testing with subdomains works seamlessly using pow and capybara-webkit, except for one small hitch. This config in my env.rb hits my dev database instead the test db:
Capybara.javascript_driver = :webkit
Capybara.run_server = false
Capybara.app_host = "http://myDomain.dev"
My database.yml is plain vanilla:
login: &login
adapter: mysql
username: root
password:
#host: mysql.example.com
development:
<<: *login
database: site_dev
test: &test
<<: *login
database: site_test
production:
<<: *login
database: site_prod
cucumber:
<<: *test
So why does this hit the dev db instead of the test db?
Why shouldn't it? pow is running as a separate process and knows bother about you spec_helper/test_helper, where you set your RAILS_ENV to test. If you want pow to run in test environment you have to explicitly set it, for example
echo export RAILS_ENV=production > .powenv