Sha256: 4175afb610624395b117f14410ca46f73acc9fd34ed880087f8cf21b9621fcc4

Contents?: true

Size: 596 Bytes

Versions: 5

Compression:

Stored size: 596 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "helper"))

class TestEncodedLinks < Test::Unit::TestCase
  def setup
    @agent = WWW::Mechanize.new
    @page = @agent.get("http://localhost/tc_encoded_links.html")
  end

  def test_click_link
    link = @page.links.first
    assert_equal('/form_post?a=b&b=c', link.href)
    page = @agent.click(link)
    assert_equal("http://localhost/form_post?a=b&b=c", page.uri.to_s)
  end

  def test_hpricot_link
    page = @agent.click(@page.search('//a').first)
    assert_equal("http://localhost/form_post?a=b&b=c", page.uri.to_s)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mechanize-0.8.0 test/test_encoded_links.rb
mechanize-0.8.2 test/test_encoded_links.rb
mechanize-0.8.1 test/test_encoded_links.rb
mechanize-0.8.3 test/test_encoded_links.rb
mechanize-0.8.4 test/test_encoded_links.rb