Skip to content

Instantly share code, notes, and snippets.

@dnch
Created April 14, 2013 23:13
Show Gist options
  • Save dnch/5384640 to your computer and use it in GitHub Desktop.
Save dnch/5384640 to your computer and use it in GitHub Desktop.
module HostnameHelper
def using_hostname(hostname)
old_host = Capybara.default_host
Capybara.default_host = "http://#{hostname}"
yield
Capybara.default_host = old_host
end
end
scenario "Dealing with a request that has no subdomain" do
using_hostname("bullshit.org") do
any_request_should_fail
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment