Sha256: 52e4325214b2d2143dc2677c08fd8637af76ab25d2c18324bfbc4d03f116cc99

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

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

describe "CheckBoxes" do
  before :all do
    @browser = Browser.new(BROWSER_OPTIONS)
  end

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

  describe "#length" do
    it "returns the number of checkboxes" do
      @browser.checkboxes.length.should == 7
    end
  end

  describe "#[]" do
    it "returns the checkbox at the given index" do
      @browser.checkboxes[1].id.should == "new_user_interests_books"
    end
  end

  describe "#each" do
    it "iterates 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
caius-celerity-0.0.6.11 spec/checkboxes_spec.rb