Skip to content

Commit

Permalink
Merge pull request sparklemotion#314 from pacop/master
Browse files Browse the repository at this point in the history
Fixed Issue 313
  • Loading branch information
leejarvis committed May 17, 2013
2 parents 14d251b + de72198 commit bc2203c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mechanize/page/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ def url
if page.bases[0] then
page.bases[0].href + src
else
page.uri + src
page.uri + Mechanize::Util.uri_escape(src)
end
else
URI src
URI Mechanize::Util.uri_escape(src)
end
end

Expand Down
1 change: 1 addition & 0 deletions test/test_mechanize_page_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def test_caption
def test_url
assert_equal ".jpg", img('src' => @src).extname
assert_equal "http://example/a.jpg", img('src' => @src).url.to_s
assert_equal "http://example/a%20.jpg", img('src' => 'http://example/a .jpg' ).url.to_s
end

def test_url_base
Expand Down

0 comments on commit bc2203c

Please sign in to comment.