Sha256: ef8fa05aff8fb0b364b913f576bef83c0d8d907dfdc2d20938d90263bc40058c

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

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

describe "Uls" do

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

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

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

  describe "#[]" do
    it "returns the ul at the given index" do
      @browser.uls[1].id.should == "navbar"
    end
  end

  describe "#each" do
    it "iterates through uls correctly" do
      @browser.uls.each_with_index do |ul, index|
        ul.name.should == @browser.ul(:index, index+1).name
        ul.id.should == @browser.ul(:index, index+1).id
        ul.value.should == @browser.ul(: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/uls_spec.rb