Make sure the paths passed to visit are prefixed with slashes (closes #249)
For Selenium and Celerity.
This commit is contained in:
parent
a04e0b4d1d
commit
7f10a74853
|
@ -158,6 +158,7 @@ class Capybara::Driver::Celerity < Capybara::Driver::Base
|
|||
private
|
||||
|
||||
def url(path)
|
||||
path = "/#{path}" unless path =~ /^\//
|
||||
rack_server.url(path)
|
||||
end
|
||||
|
||||
|
|
|
@ -155,6 +155,7 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
|
|||
private
|
||||
|
||||
def url(path)
|
||||
path = "/#{path}" unless path =~ /^\//
|
||||
rack_server.url(path)
|
||||
end
|
||||
|
||||
|
|
|
@ -14,6 +14,11 @@ shared_examples_for 'driver' do
|
|||
@driver.visit('/foo')
|
||||
@driver.current_url.should include('/foo')
|
||||
end
|
||||
|
||||
it "should prefix paths with slashes to make sure the url is valid" do
|
||||
@driver.visit('foo')
|
||||
@driver.current_url.should include('/foo')
|
||||
end
|
||||
end
|
||||
|
||||
describe '#body' do
|
||||
|
|
Loading…
Reference in New Issue