Sha256: 4b294ed356daa442a397a7712ddb17884af0fe9ffc6eef149698e7232f3a1961

Contents?: true

Size: 1022 Bytes

Versions: 9

Compression:

Stored size: 1022 Bytes

Contents

require 'spec_helper'
require 'druid/elements'

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

  describe "interface" do
    let(:element) { double("element") }
    let(:driver) { double("driver") }
    let(:radio) { Druid::Elements::RadioButton.new(element)}

    it "should select" do
      expect(element).to receive(:set)
      radio.select
    end

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

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

    it "should register as type :radio" do
      expect(Druid::Elements.element_class_for(:input, :radio)).to be Druid::Elements::RadioButton
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
druid-ts-1.1.8 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.7 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.6 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.5 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.4 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.3 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.2 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.1 spec/druid/elements/radio_button_spec.rb
druid-ts-1.1.0 spec/druid/elements/radio_button_spec.rb