Skip to content

Instantly share code, notes, and snippets.

View terrainoob's full-sized avatar

Chris Booth terrainoob

View GitHub Profile
Given /^I visit subdomain "(.+)"$/ do |sub|
#host! "#{sub}.example.com" #for webrat
Capybara.default_host = "#{sub}.example.com" #for Rack::Test
Capybara.app_host = "http://#{sub}.example.com:9887" if Capybara.current_driver == :culerity
################################################################################
# As far as I know, you have to put all the {sub}.example.com entries that you're
# using in your /etc/hosts file for the Culerity tests. This didn't seem to be
# required for Rack::Test
################################################################################
@terrainoob
terrainoob / custom_steps.rb
Created May 6, 2009 14:20
Cucumber subdomain testing
Given /^I visit subdomain (.+)$/ do |sub|
host! "#{sub}.#{TEST_DOMAIN}" #TEST_DOMAIN is defined in test.rb. In my case TEST_DOMAIN = 'example.com'
end