Sha256: 696c26d46a8e15d1d81e400c9b17234a46ec2ad4a8403a18455da8c4a82817f9

Contents?: true

Size: 1010 Bytes

Versions: 3

Compression:

Stored size: 1010 Bytes

Contents

# encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)

describe "Metas" do

  before :each do
    browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
  end

  bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
    describe "with selectors" do
      it "returns the matching elements" do
        browser.metas(:name => "description").to_a.should == [browser.meta(:name => "description")]
      end
    end
  end
  
  describe "#length" do
    it "returns the number of meta elements" do
      browser.metas.length.should == 2
    end
  end

  describe "#[]" do
    it "returns the meta element at the given index" do
      browser.metas[1].name.should == "description"
    end
  end

  describe "#each" do
    it "iterates through meta elements correctly" do
      count = 0

      browser.metas.each_with_index do |m, index|
        m.content.should == browser.meta(:index, index).content
        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
watir-webdriver-0.1.4 spec/watirspec/metas_spec.rb
watir-webdriver-0.1.3 spec/watirspec/metas_spec.rb
watir-webdriver-0.1.2 spec/watirspec/metas_spec.rb