Sha256: 5be392e5681613a21a722e068371c2a587c97b4c0cc9c84957d1e2f1bf395760

Contents?: true

Size: 989 Bytes

Versions: 2

Compression:

Stored size: 989 Bytes

Contents

require 'spec_helper'
require 'druid/elements'

describe Druid::Elements::TextArea do
  describe "when mapping how to find an element" do
    it "should map watir types to same" do
      [:class, :id, :index, :name, :xpath].each do |t|
        identifier = Druid::Elements::TextArea.identifier_for t => 'value'
        expect(identifier.keys.first).to eql t
      end
    end

    it "should map selenium types to watir" do
      identifier = Druid::Elements::TextArea.identifier_for :css => 'value'
      expect(identifier.keys.first).to eql :tag_name
    end
  end

  describe "interface" do
    let(:element) { double "element" }
    let(:text_area) { Druid::Elements::TextArea.new(element) }
    it "should set its' value" do
      expect(element).to receive(:send_keys).with('test')
      text_area.value = 'test'
    end

    it "should register with tag_name :textarea" do
      expect(Druid::Elements.element_class_for(:textarea)).to be Druid::Elements::TextArea
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
druid-ts-1.1.1 spec/druid/elements/text_area_spec.rb
druid-ts-1.1.0 spec/druid/elements/text_area_spec.rb