Sha256: 8ca685ea91a01829e2f8cc110a543fef854dbe60911d622411ca8069d28e031f

Contents?: true

Size: 1 KB

Versions: 7

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'
require 'druid/elements'

describe Druid::Elements::Area do
  context "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::Area.identifier_for t => 'value'
        expect(identifier.keys.first).to eql t
      end
    end
  end

  context "implementation" do
    let(:element) { double('element') }
    let(:area) { Druid::Elements::Area.new(element) }

    it "should know its coords" do
      expect(element).to receive(:attribute_value).with(:coords).and_return("1,2,3,4")
      expect(area.coords).to eql "1,2,3,4"
    end

    it "should know its shape" do
      expect(element).to receive(:attribute_value).with(:shape).and_return("circle")
      expect(area.shape).to eql "circle"
    end

    it "should know its href" do
      expect(element).to receive(:attribute_value).with(:href).and_return("twitter.com")
      expect(area.href).to eql "twitter.com"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
druid-ts-1.2.2 spec/druid/elements/area_spec.rb
druid-ts-1.2.1 spec/druid/elements/area_spec.rb
druid-ts-1.2.0 spec/druid/elements/area_spec.rb
druid-ts-1.1.8 spec/druid/elements/area_spec.rb
druid-ts-1.1.7 spec/druid/elements/area_spec.rb
druid-ts-1.1.6 spec/druid/elements/area_spec.rb
druid-ts-1.1.5 spec/druid/elements/area_spec.rb