Sha256: 6bb8d631b4f7e89d2b5f60c938e9098bc04e43d398aad40c17172dde1ce2ab5c

Contents?: true

Size: 811 Bytes

Versions: 14

Compression:

Stored size: 811 Bytes

Contents

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

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

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

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

  def test_space_in_link
    assert_nothing_raised do
      @agent.click @page.links.first
    end
    assert_match(/alt_text.html$/, @agent.history.last.uri.to_s)
    assert_equal(2, @agent.history.length)
  end

  def test_space_in_url
    page = nil
    assert_nothing_raised do
      page = @agent.get("http://localhost:#{PORT}/tc_bad_links.html ")
    end
    assert_match(/tc_bad_links.html$/, @agent.history.last.uri.to_s)
    assert_equal(2, @agent.history.length)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mechanize-0.6.0 test/tc_bad_links.rb
mechanize-0.6.1 test/tc_bad_links.rb
mechanize-0.6.10 test/tc_bad_links.rb
mechanize-0.5.3 test/tc_bad_links.rb
mechanize-0.5.4 test/tc_bad_links.rb
mechanize-0.6.6 test/tc_bad_links.rb
mechanize-0.6.7 test/tc_bad_links.rb
mechanize-0.6.8 test/tc_bad_links.rb
mechanize-0.6.5 test/tc_bad_links.rb
mechanize-0.6.9 test/tc_bad_links.rb
mechanize-0.6.3 test/tc_bad_links.rb
mechanize-0.6.11 test/tc_bad_links.rb
mechanize-0.6.2 test/tc_bad_links.rb
mechanize-0.6.4 test/tc_bad_links.rb