Created
April 14, 2013 23:13
-
-
Save dnch/5384640 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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