Sha256: 6785d8ed069ae18b39754e1aa2ae7f55945197a2210d5f42cf6cf444d98282b6

Contents?: true

Size: 993 Bytes

Versions: 12

Compression:

Stored size: 993 Bytes

Contents

require 'spec_helper'
require 'druid/elements'

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

  describe "interface" do
    let(:element) { double 'element' }
    let(:checkbox) { Druid::Elements::CheckBox.new(element) }

    it "should check" do
      expect(element).to receive(:set)
      checkbox.check
    end

    it "should uncheck" do
      expect(element).to receive(:clear)
      checkbox.uncheck
    end

    it "should know if it is checked" do
      expect(element).to receive(:set?)
      checkbox.checked?
    end

    it "should register with type :checkbox" do
      expect(Druid::Elements.element_class_for(:input, :checkbox)).to be Druid::Elements::CheckBox
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
druid-ts-1.2.2 spec/druid/elements/check_box_spec.rb
druid-ts-1.2.1 spec/druid/elements/check_box_spec.rb
druid-ts-1.2.0 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.8 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.7 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.6 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.5 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.4 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.3 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.2 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.1 spec/druid/elements/check_box_spec.rb
druid-ts-1.1.0 spec/druid/elements/check_box_spec.rb