1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Handle absolute URIs (happens with Rails)

This commit is contained in:
Aslak Hellesøy 2009-12-09 16:39:03 +01:00
parent 76bda6e558
commit 61338d0786

View file

@ -1,3 +1,4 @@
require 'uri'
require 'net/http' require 'net/http'
require 'rack' require 'rack'
require 'rack/handler/mongrel' require 'rack/handler/mongrel'
@ -18,6 +19,7 @@ class Capybara::Server
end end
def url(path) def url(path)
path = URI.parse(path).request_uri if path =~ /^http/
"http://#{host}:#{port}#{path}" "http://#{host}:#{port}#{path}"
end end