Skip to content

Instantly share code, notes, and snippets.

@cherring
Created January 17, 2012 07:57
Show Gist options
  • Select an option

  • Save cherring/1625545 to your computer and use it in GitHub Desktop.

Select an option

Save cherring/1625545 to your computer and use it in GitHub Desktop.
Spork.prefork do
require 'cucumber/rails'
require 'factory_girl_rails'
require 'factory_girl/step_definitions'
require 'database_cleaner'
require 'database_cleaner/cucumber'
Capybara.default_selector = :css
Capybara.default_driver = :selenium
Capybara.server_port = "9887"
Capybara.default_host = "http://www.lvh.me"
Capybara.app_host = "http://www.lvh.me:9887"
DatabaseCleaner.strategy = :truncation
ActiveSupport::Dependencies.clear
end
But then in the tests:
(rdb:1) new_user_session_url
"http://www.example.com/users/sign_in"
so of course it tries to go to the wrong place when I visit new_user_session_url, anyone know how to get around this?
@laktek
Copy link

laktek commented Jan 17, 2012

Instead of Capybara.app_host try adding Capybara.server_host?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment