Sha256: 5379d63753188ce4aa596b8a0188f721057c6e34af128a43f62db0be5f48643e

Contents?: true

Size: 944 Bytes

Versions: 1

Compression:

Stored size: 944 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe CheckBoxes do
  before :all do
    @browser = IE.new
    add_spec_checker(@browser)    
  end

  before :each do
    @browser.goto(TEST_HOST + "/forms_with_input_elements.html")
  end

  describe "#length" do
    it "should return the number of checkboxes" do
      @browser.checkboxes.length.should == 7
    end
  end
  
  describe "#[]" do
    it "should return the checkbox at the given index" do
      @browser.checkboxes[1].id.should == "new_user_interests_books"
    end
  end

  describe "#each" do
    it "should iterate through checkboxes correctly" do
      @browser.checkboxes.each_with_index do |c, index|
        c.name.should == @browser.checkbox(:index, index+1).name
        c.id.should == @browser.checkbox(:index, index+1).id
        c.value.should == @browser.checkbox(:index, index+1).value
      end
    end
  end
  
  after :all do
    @browser.close
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
celerity-0.0.3 spec/checkboxes_spec.rb