Sha256: f3bf567637bfb4bd25f9eb6be328d3984215a06bf1432195d3106ecc99fa3a6a

Contents?: true

Size: 1.12 KB

Versions: 15

Compression:

Stored size: 1.12 KB

Contents

require File.expand_path(File.join(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

15 entries across 15 versions & 5 rubygems

Version Path
eric-mechanize-0.9.3.20090623142847 test/test_html_unscape_forms.rb
knu-mechanize-0.9.3.20090623142847 test/test_html_unscape_forms.rb
tenderlove-mechanize-0.9.3.20090617085936 test/test_html_unscape_forms.rb
tenderlove-mechanize-0.9.3.20090623142847 test/test_html_unscape_forms.rb
mechanize-ntlm-0.9.1 test/test_html_unscape_forms.rb
mechanize-0.8.0 test/test_html_unscape_forms.rb
mechanize-0.8.1 test/test_html_unscape_forms.rb
mechanize-0.8.3 test/test_html_unscape_forms.rb
mechanize-0.8.4 test/test_html_unscape_forms.rb
mechanize-0.8.2 test/test_html_unscape_forms.rb
mechanize-0.9.0 test/test_html_unscape_forms.rb
mechanize-0.9.1 test/test_html_unscape_forms.rb
mechanize-0.8.5 test/test_html_unscape_forms.rb
mechanize-0.9.3 test/test_html_unscape_forms.rb
mechanize-0.9.2 test/test_html_unscape_forms.rb