Sha256: f5a37360c99e6f23ff46cfdcf4f5bff2c2457eeb31c9630fc0e17f8354445697

Contents?: true

Size: 905 Bytes

Versions: 8

Compression:

Stored size: 905 Bytes

Contents

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

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

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

  def setup
    @agent = WWW::Mechanize.new
  end

  def test_submit_button
    html = <<-END
    <html><body>
    <form><input type="submit" value="submit" /></form>
    </body></html>
    END
    page = WWW::Mechanize::Page.new(  nil, html_response, html, 200, @agent )
    assert_equal(1, page.forms.length)
    assert_equal(1, page.forms.first.buttons.length)
  end

  def test_button_button
    html = <<-END
    <html><body>
    <form><input type="button" value="submit" /></form>
    </body></html>
    END
    page = WWW::Mechanize::Page.new(  nil, html_response, html, 200, @agent )
    assert_equal(1, page.forms.length)
    assert_equal(1, page.forms.first.buttons.length)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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