Sha256: a74d80e34a75aafdfb86534b5b650bf40e0215ae38a797cd5c525e6ca77460be

Contents?: true

Size: 594 Bytes

Versions: 10

Compression:

Stored size: 594 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

10 entries across 10 versions & 5 rubygems

Version Path
eric-mechanize-0.9.3.20090623142847 test/test_encoded_links.rb
knu-mechanize-0.9.3.20090623142847 test/test_encoded_links.rb
tenderlove-mechanize-0.9.3.20090617085936 test/test_encoded_links.rb
tenderlove-mechanize-0.9.3.20090623142847 test/test_encoded_links.rb
mechanize-ntlm-0.9.1 test/test_encoded_links.rb
mechanize-0.9.0 test/test_encoded_links.rb
mechanize-0.8.5 test/test_encoded_links.rb
mechanize-0.9.3 test/test_encoded_links.rb
mechanize-0.9.1 test/test_encoded_links.rb
mechanize-0.9.2 test/test_encoded_links.rb