Sha256: 5d5a580af5ed1a7bb87826e14e4cfed6e99af752f1fed9ace60d231097cf5a77

Contents?: true

Size: 717 Bytes

Versions: 9

Compression:

Stored size: 717 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), "..", "lib")

require 'test/unit'
require 'rubygems'
require 'mechanize'
require 'test_includes'

class TestEncodedLinks < Test::Unit::TestCase
  include TestMethods

  def setup
    @agent = WWW::Mechanize.new
    @page = @agent.get("http://localhost:#{PORT}/tc_encoded_links.html")
  end

  def test_click_link
    link = @page.links.first
    assert_equal('/form_post?a=b&amp;b=c', link.href)
    page = @agent.click(link)
    assert_equal("http://localhost:#{PORT}/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:#{PORT}/form_post?a=b&b=c", page.uri.to_s)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mechanize-0.6.10 test/tc_encoded_links.rb
mechanize-0.6.5 test/tc_encoded_links.rb
mechanize-0.6.9 test/tc_encoded_links.rb
mechanize-0.6.3 test/tc_encoded_links.rb
mechanize-0.6.4 test/tc_encoded_links.rb
mechanize-0.6.6 test/tc_encoded_links.rb
mechanize-0.6.7 test/tc_encoded_links.rb
mechanize-0.6.11 test/tc_encoded_links.rb
mechanize-0.6.8 test/tc_encoded_links.rb