Sha256: e8dfe5f0fd3963c458391fcde6dd2a80543661dee3fe2d50ffc79a1f45b617bf

Contents?: true

Size: 733 Bytes

Versions: 25

Compression:

Stored size: 733 Bytes

Contents

require 'mechanize/test_case'

class TestMechanizeFormCheckBox < Mechanize::TestCase

  def setup
    super

    @page = @mech.get('http://localhost/tc_checkboxes.html')
  end

  def test_check
    form = @page.forms.first

    form.checkbox_with(:name => 'green').check

    assert(form.checkbox_with(:name => 'green').checked)

    %w{ red blue yellow brown }.each do |color|
      assert_equal(false, form.checkbox_with(:name => color).checked)
    end
  end

  def test_uncheck
    form = @page.forms.first

    checkbox = form.checkbox_with(:name => 'green')

    checkbox.check

    assert form.checkbox_with(:name => 'green').checked

    checkbox.uncheck

    assert !form.checkbox_with(:name => 'green').checked
  end

end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
mechanize-2.7.5 test/test_mechanize_form_check_box.rb
mechanize-2.7.4 test/test_mechanize_form_check_box.rb
mechanize-2.7.3 test/test_mechanize_form_check_box.rb
mechanize-2.7.2 test/test_mechanize_form_check_box.rb
mechanize-2.7.1 test/test_mechanize_form_check_box.rb
mechanize-2.7.0 test/test_mechanize_form_check_box.rb
mechanize-2.6.0 test/test_mechanize_form_check_box.rb
mechanize-2.5.1 test/test_mechanize_form_check_box.rb
mechanize-2.5 test/test_mechanize_form_check_box.rb
mechanize-2.4 test/test_mechanize_form_check_box.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/mechanize-2.3/test/test_mechanize_form_check_box.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/mechanize-2.3/test/test_mechanize_form_check_box.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/mechanize-2.3/test/test_mechanize_form_check_box.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/mechanize-2.3/test/test_mechanize_form_check_box.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/mechanize-2.3/test/test_mechanize_form_check_box.rb
mechanize-2.3 test/test_mechanize_form_check_box.rb
mechanize-2.2.1 test/test_mechanize_form_check_box.rb
mechanize-2.2 test/test_mechanize_form_check_box.rb
mechanize-2.1.1 test/test_mechanize_form_check_box.rb
domo-0.0.5 vendor/bundle/ruby/1.9.1/gems/mechanize-2.1/test/test_mechanize_form_check_box.rb