Sha256: 1c02c31c9cf49779aea6b963d8878a3bcf6c90e048c196ba00d1e3f6bad19b16
Contents?: true
Size: 1.18 KB
Versions: 2
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' require 'druid/elements' describe Druid::Elements::OrderedList do describe "when mapping how to find an element" do it "should map watir types to same" do [:class, :id, :index, :xpath].each do |t| identifier = Druid::Elements::OrderedList.identifier_for t => 'value' expect(identifier.keys.first).to eql t end end end describe "interface" do let(:element) { double 'element' } let(:ol) { Druid::Elements::OrderedList.new(element) } it "should return a list item when indexed" do allow(element).to receive(:ols).and_return(element) expect(element).to receive(:[]) ol[1] end it "should know how many list items it contains" do allow(element).to receive(:ols).and_return([element]) expect(ol.items).to eql 1 end it "should iterate over the list items" do expect(ol).to receive(:items).and_return(2) allow(ol).to receive(:[]) count = 0 ol.each do count += 1 end expect(count).to eql 2 end it "should register as tag_name :ol" do expect(Druid::Elements.element_class_for(:ol)).to be Druid::Elements::OrderedList end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
druid-ts-1.2.2 | spec/druid/elements/ordered_list_spec.rb |
druid-ts-1.2.1 | spec/druid/elements/ordered_list_spec.rb |