Sha256: 1e91a8d632fa028a276c1e7e9ea356870d8642ca672ff40686b80a0f73e82c43

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

require File.dirname(__FILE__) + "/helper"

class TestCheckBoxes < Test::Unit::TestCase
  def test_field
    f = WWW::Mechanize::Form::Field.new('a&amp;b', 'a&amp;b')
    assert_equal('a&b', f.name)
    assert_equal('a&b', f.value)

    f = WWW::Mechanize::Form::Field.new('a&b', 'a&b')
    assert_equal('a&b', f.name)
    assert_equal('a&b', f.value)

    f = WWW::Mechanize::Form::Field.new('a&#38;b', 'a&#38;b')
    assert_equal('a&b', f.name)
    assert_equal('a&b', f.value)
  end

  def test_file_upload
    f = WWW::Mechanize::Form::FileUpload.new('a&amp;b', 'a&amp;b')
    assert_equal('a&b', f.name)
    assert_equal('a&b', f.file_name)

    f = WWW::Mechanize::Form::FileUpload.new('a&b', 'a&b')
    assert_equal('a&b', f.name)
    assert_equal('a&b', f.file_name)
  end

  def test_image_button
    f = WWW::Mechanize::Form::ImageButton.new('a&amp;b', 'a&amp;b')
    assert_equal('a&b', f.name)
    assert_equal('a&b', f.value)
  end

  def test_radio_button
    f = WWW::Mechanize::Form::RadioButton.new('a&amp;b', 'a&amp;b', nil, nil)
    assert_equal('a&b', f.name)
    assert_equal('a&b', f.value)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mechanize-0.7.2 test/tc_html_unscape_forms.rb
mechanize-0.7.5 test/tc_html_unscape_forms.rb
mechanize-0.7.3 test/tc_html_unscape_forms.rb
mechanize-0.7.4 test/tc_html_unscape_forms.rb
mechanize-0.7.0 test/tc_html_unscape_forms.rb
mechanize-0.7.1 test/tc_html_unscape_forms.rb
mechanize-0.7.6 test/tc_html_unscape_forms.rb
mechanize-0.7.7 test/test_html_unscape_forms.rb
mechanize-0.7.8 test/test_html_unscape_forms.rb