Sha256: 3522463067ae1f680f7fe6c151b7ea2c6bb6bcd5c72ef9d0ff8ddd60db6baf42

Contents?: true

Size: 929 Bytes

Versions: 3

Compression:

Stored size: 929 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 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

3 entries across 3 versions & 1 rubygems

Version Path
druid-ts-1.2.2 spec/druid/elements/radio_button_spec.rb
druid-ts-1.2.1 spec/druid/elements/radio_button_spec.rb
druid-ts-1.2.0 spec/druid/elements/radio_button_spec.rb