Sha256: 41cf035e8905cc44deb3b0e076e12b811d98650617eb5b50dfee890ea4123c6b

Contents?: true

Size: 893 Bytes

Versions: 1

Compression:

Stored size: 893 Bytes

Contents

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

describe "Labels" 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 labels" do
      @browser.labels.length.should == 26 # changed this from 25 - Jari
    end
  end

  describe "#[]" do
    it "returns the pre at the given index" do
      @browser.labels[1].id.should == "first_label"
    end
  end

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