Sha256: 7039bf0da2e021905a7fff151b0ded33846d2850dc3a3953cd5dfd951766732c

Contents?: true

Size: 898 Bytes

Versions: 25

Compression:

Stored size: 898 Bytes

Contents

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

describe "FileFields" do

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

  describe "#length" do
    it "returns the correct number of file fields" do
      browser.file_fields.length.should == 2
    end
  end

  describe "#[]" do
    it "returns the file field at the given index" do
      browser.file_fields[1].id.should == "new_user_portrait"
    end
  end

  describe "#each" do
    it "iterates through file fields correctly" do
      count = 0

      browser.file_fields.each_with_index do |f, index|
        f.name.should == browser.file_field(:index, index+1).name
        f.id.should ==  browser.file_field(:index, index+1).id
        f.value.should == browser.file_field(:index, index+1).value

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
operawatir-0.4-jruby spec/legacy_watirspec/filefields_spec.rb
operawatir-0.3.7.pre2-jruby spec/legacy_watirspec/filefields_spec.rb
operawatir-0.3.7.pre1-jruby spec/legacy_watirspec/filefields_spec.rb
operawatir-0.3.2-jruby spec/legacy_watirspec/filefields_spec.rb
operawatir-0.3-jruby spec/legacy_watirspec/filefields_spec.rb