Sha256: 59e0875365712922d2b4ca3bc72e41a9fc83ff5f340fd649f8084fecaa5e1a08

Contents?: true

Size: 852 Bytes

Versions: 5

Compression:

Stored size: 852 Bytes

Contents

require 'spec_helper'
require 'druid/elements'

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

  context "implementation" do
    let(:element) { double('canvas_element') }
    let(:canvas) { Druid::Elements::Canvas.new(element) }

    it "should knwo its width" do
      expect(element).to receive(:attribute_value).with(:width).and_return("400")
      expect(canvas.width).to eql 400
    end

    it "should know its height" do
      expect(element).to receive(:attribute_value).with(:height).and_return("100")
      expect(canvas.height).to eql 100
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
druid-ts-1.2.0 spec/druid/elements/canvas_spec.rb
druid-ts-1.1.8 spec/druid/elements/canvas_spec.rb
druid-ts-1.1.7 spec/druid/elements/canvas_spec.rb
druid-ts-1.1.6 spec/druid/elements/canvas_spec.rb
druid-ts-1.1.5 spec/druid/elements/canvas_spec.rb