Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
capybara with subdomains
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
################################################################################
end
Scenario: This is a Rack::Test scenario
Given I visit subdomain "test"
And I log in as user "someone" with password "test" #another custom step
Yadda Yadda
@culerity
Scenario: This is a culerity scenario
Given I visit subdomain "test"
And I log in as user "someone" with password "test" #another custom step
Yadda Yadda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.