Merge commit 'lawrencepit/banana'
Conflicts: spec/api/click_link_spec.rb
This commit is contained in:
commit
74dce87c3e
@ -54,7 +54,7 @@ module Webrat
|
||||
def absolute_href
|
||||
if href =~ /^\?/
|
||||
"#{@session.current_url}#{href}"
|
||||
elsif href !~ %r{^https?://www.example.com(/.*)} && (href !~ /^\//)
|
||||
elsif href !~ %r{^https?://} && (href !~ /^\//)
|
||||
"#{@session.current_url}/#{href}"
|
||||
else
|
||||
href
|
||||
|
@ -270,6 +270,15 @@ describe "click_link" do
|
||||
end
|
||||
|
||||
it "should follow fully qualified local links" do
|
||||
@session.stub!(:current_url).and_return("/page")
|
||||
@session.response_body = <<-EOS
|
||||
<a href="http://subdomain.example.com/page/sub">Jump to sub page</a>
|
||||
EOS
|
||||
@session.should_receive(:get).with("http://subdomain.example.com/page/sub", {})
|
||||
@session.click_link "Jump to sub page"
|
||||
end
|
||||
|
||||
it "should follow fully qualified local links to example.com" do
|
||||
@session.response_body = <<-EOS
|
||||
<a href="http://www.example.com/page/sub">Jump to sub page</a>
|
||||
EOS
|
||||
|
Loading…
Reference in New Issue
Block a user